* Added HandsActions & Actions indexes & foreign keys to Database.py

* Added 'createActionsTable' to the SQL dictionary
* Updated create_tables so 'createActionsTable' would be called
* Updated dumpdatabase(), adding in u'Actions'
* Added action name & code info for filling the Actions table in FillDefaultData()
This commit is contained in:
Chaz
2010-09-28 16:59:37 -04:00
parent 94d4bf6ed5
commit c1b2a0040c
2 changed files with 46 additions and 2 deletions
+22 -1
View File
@@ -153,7 +153,28 @@ class Sql:
tourneyId BIGINT NOT NULL,
rawTourney TEXT NOT NULL,
complain BOOLEAN NOT NULL DEFAULT FALSE)"""
################################
# Create Actions
################################
if db_server == 'mysql':
self.query['createActionsTable'] = """CREATE TABLE Actions (
id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
name varchar(32) NOT NULL,
code char(2) NOT NULL)
ENGINE=INNODB"""
elif db_server == 'postgresql':
self.query['createActionsTable'] = """CREATE TABLE Actions (
id SERIAL, PRIMARY KEY (id),
name varchar(32),
code char(2))"""
elif db_server == 'sqlite':
self.query['createActionsTable'] = """CREATE TABLE Actions (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
code TEXT NOT NULL)"""
################################
# Create Sites
################################