Set penguin puffle item default quantity to 1

This commit is contained in:
Ben 2019-06-21 01:48:31 +01:00
parent 01dc037afb
commit 4c673ea089
2 changed files with 2 additions and 2 deletions

View File

@ -1010,7 +1010,7 @@ DROP TABLE IF EXISTS penguin_puffle_item;
CREATE TABLE penguin_puffle_item (
penguin_id INT NOT NULL,
item_id INT NOT NULL,
quantity SMALLINT NOT NULL,
quantity SMALLINT NOT NULL DEFAULT 1,
PRIMARY KEY (penguin_id, item_id),
CONSTRAINT penguin_puffle_item_ibfk_1 FOREIGN KEY (penguin_id) REFERENCES penguin (id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT penguin_puffle_item_ibfk_2 FOREIGN KEY (item_id) REFERENCES puffle_item (id) ON DELETE CASCADE ON UPDATE CASCADE

View File

@ -96,7 +96,7 @@ class PenguinPuffleItem(db.Model):
nullable=False)
item_id = db.Column(db.ForeignKey('puffle_item.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
nullable=False)
quantity = db.Column(db.SmallInteger, nullable=False)
quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
class PenguinLaunchGame(db.Model):