From c3688f2522d05ae22d58f56d94014636dd4cdc5f Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Sat, 9 Apr 2011 19:33:42 +0200 Subject: [PATCH] make gametypes' NOT NULL consistent across backends --- pyfpdb/SQL.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index ed62fc6b..6245e94b 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -253,34 +253,34 @@ class Sql: ENGINE=INNODB""" elif db_server == 'postgresql': self.query['createGametypesTable'] = """CREATE TABLE Gametypes ( - id SERIAL, PRIMARY KEY (id), - siteId INTEGER, FOREIGN KEY (siteId) REFERENCES Sites(id), - currency varchar(4), - type char(4), - base char(4), - category varchar(9), - limitType char(2), - hiLo char(1), - mix char(9), + id SERIAL NOT NULL, PRIMARY KEY (id), + siteId INTEGER NOT NULL, FOREIGN KEY (siteId) REFERENCES Sites(id), + currency varchar(4) NOT NULL, + type char(4) NOT NULL, + base char(4) NOT NULL, + category varchar(9) NOT NULL, + limitType char(2) NOT NULL, + hiLo char(1) NOT NULL, + mix char(9) NOT NULL, smallBlind int, bigBlind int, - smallBet int, - bigBet int)""" + smallBet int NOT NULL, + bigBet int NOT NULL)""" elif db_server == 'sqlite': self.query['createGametypesTable'] = """CREATE TABLE Gametypes ( - id INTEGER PRIMARY KEY, - siteId INTEGER, - currency TEXT, - type TEXT, - base TEXT, - category TEXT, - limitType TEXT, - hiLo TEXT, - mix TEXT, + id INTEGER PRIMARY KEY NOT NULL, + siteId INTEGER NOT NULL, + currency TEXT NOT NULL, + type TEXT NOT NULL, + base TEXT NOT NULL, + category TEXT NOT NULL, + limitType TEXT NOT NULL, + hiLo TEXT NOT NULL, + mix TEXT NOT NULL, smallBlind INTEGER, bigBlind INTEGER, - smallBet INTEGER, - bigBet INTEGER, + smallBet INTEGER NOT NULL, + bigBet INTEGER NOT NULL, FOREIGN KEY(siteId) REFERENCES Sites(id) ON DELETE CASCADE)"""