Removal of unnecessary columns that aren't utilized in the warning table

This commit is contained in:
rsakeys 2019-08-31 22:11:39 +04:00
parent 82eacb42e7
commit e62b4f6bd7
2 changed files with 2 additions and 7 deletions

View File

@ -690,11 +690,8 @@ COMMENT ON COLUMN ban.comment IS 'Ban comment';
DROP TABLE IF EXISTS warning;
CREATE TABLE warning (
penguin_id INT NOT NULL,
issued TIMESTAMP NOT NULL,
expires TIMESTAMP NOT NULL,
type SMALLINT NOT NULL,
comment TEXT NOT NULL,
PRIMARY KEY (penguin_id, issued, expires),
PRIMARY KEY (penguin_id, expires),
CONSTRAINT warning_ibfk_1 FOREIGN KEY (penguin_id) REFERENCES penguin (id) ON DELETE CASCADE ON UPDATE CASCADE
);

View File

@ -18,10 +18,8 @@ class Warning(db.Model):
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
nullable=False)
issued = db.Column(db.DateTime, primary_key=True, nullable=False)
expires = db.Column(db.DateTime, primary_key=True, nullable=False)
type = db.Column(db.SmallInteger, nullable=False)
comment = db.Column(db.Text, nullable=False)
class Report(db.Model):