From 4c673ea089a22521a83d9611cf2b363eccd66676 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 21 Jun 2019 01:48:31 +0100 Subject: [PATCH] Set penguin puffle item default quantity to 1 --- houdini.sql | 2 +- houdini/data/pet.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/houdini.sql b/houdini.sql index 9a2103b..3aa36b3 100644 --- a/houdini.sql +++ b/houdini.sql @@ -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 diff --git a/houdini/data/pet.py b/houdini/data/pet.py index 78b79dd..6361cd2 100644 --- a/houdini/data/pet.py +++ b/houdini/data/pet.py @@ -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):