Added additional field in status table
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
4fbcce6303
commit
aa44873891
1 changed files with 1 additions and 1 deletions
|
@ -84,7 +84,7 @@ if force:
|
|||
cursor.execute("DROP TRIGGER IF EXISTS update_top_level")
|
||||
cursor.execute("DROP TRIGGER IF EXISTS update_second_level")
|
||||
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS status (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(15) UNIQUE NOT NULL);")
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS status (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(15) UNIQUE NOT NULL, color VARCHAR(20));")
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS topLevel (id INT PRIMARY KEY AUTO_INCREMENT, name CHAR(7) UNIQUE NOT NULL, status_id INT NOT NULL, FOREIGN KEY (status_id) REFERENCES status(id));")
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS secondLevel (id INT PRIMARY KEY AUTO_INCREMENT, name CHAR(7) UNIQUE NOT NULL, status_id INT NOT NULL, parent_id INT NOT NULL, FOREIGN KEY (status_id) REFERENCES status(id), FOREIGN KEY (parent_id) REFERENCES topLevel(id));")
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS tile (id INT PRIMARY KEY AUTO_INCREMENT, status_id INT NOT NULL, parent_id INT NOT NULL, FOREIGN KEY (status_id) REFERENCES status(id), FOREIGN KEY (parent_id) REFERENCES secondLevel(id));")
|
||||
|
|
Loading…
Reference in a new issue