Skip to content
Snippets Groups Projects
Commit d54709d3 authored by alapendr's avatar alapendr
Browse files

db_creation.py: modify a mistake in the db creation script

parent d40b0c82
No related branches found
No related tags found
No related merge requests found
...@@ -61,8 +61,7 @@ def create_cin_projects_table(conn: sqlite3.Connection) -> None: ...@@ -61,8 +61,7 @@ def create_cin_projects_table(conn: sqlite3.Connection) -> None:
""" """
c = conn.cursor() c = conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS cin_projects c.execute('''CREATE TABLE IF NOT EXISTS cin_projects
([id] INT NOT NULL, ([id_sample] VARCHAR(60) NOT NULL,
[id_sample] VARCHAR(60) NOT NULL,
[id_project] VARCHAR(45) NOT NULL, [id_project] VARCHAR(45) NOT NULL,
[database] VARCHAR(45) NOT NULL, [database] VARCHAR(45) NOT NULL,
[name] VARCHAR(60) NULL, [name] VARCHAR(60) NULL,
...@@ -71,7 +70,7 @@ def create_cin_projects_table(conn: sqlite3.Connection) -> None: ...@@ -71,7 +70,7 @@ def create_cin_projects_table(conn: sqlite3.Connection) -> None:
[cell_line] VARCHAR(45) NOT NULL, [cell_line] VARCHAR(45) NOT NULL,
[institute] VARCHAR(45) NULL, [institute] VARCHAR(45) NULL,
[citation] VARCHAR(20) NULL, [citation] VARCHAR(20) NULL,
PRIMARY KEY ([id]))''') PRIMARY KEY ([id_sample]))''')
conn.commit() conn.commit()
...@@ -128,7 +127,8 @@ def create_cin_exon_interaction_table(conn: sqlite3.Connection) -> None: ...@@ -128,7 +127,8 @@ def create_cin_exon_interaction_table(conn: sqlite3.Connection) -> None:
PRIMARY KEY ([id]), PRIMARY KEY ([id]),
FOREIGN KEY ([exon1]) REFERENCES cin_exon([id]), FOREIGN KEY ([exon1]) REFERENCES cin_exon([id]),
FOREIGN KEY ([exon2]) REFERENCES cin_exon([id]), FOREIGN KEY ([exon2]) REFERENCES cin_exon([id]),
FOREIGN KEY ([id_project]) REFERENCES cin_projects([id]))''') FOREIGN KEY ([id_project])
REFERENCES cin_projects([id_sample]))''')
conn.commit() conn.commit()
...@@ -149,7 +149,8 @@ def create_cin_gene_interaction_table(conn: sqlite3.Connection) -> None: ...@@ -149,7 +149,8 @@ def create_cin_gene_interaction_table(conn: sqlite3.Connection) -> None:
PRIMARY KEY ([id]), PRIMARY KEY ([id]),
FOREIGN KEY ([gene1]) REFERENCES cin_gene([id]), FOREIGN KEY ([gene1]) REFERENCES cin_gene([id]),
FOREIGN KEY ([gene2]) REFERENCES cin_gene([id]), FOREIGN KEY ([gene2]) REFERENCES cin_gene([id]),
FOREIGN KEY ([id_project]) REFERENCES cin_projects([id]))''') FOREIGN KEY ([id_project])
REFERENCES cin_projects([id_sample]))''')
conn.commit() conn.commit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment