.seen and .tell: add some constraints on columns.
This commit is contained in:
parent
ba3d706b39
commit
92b00e7cad
|
@ -70,7 +70,8 @@ def dbconnect(db):
|
||||||
|
|
||||||
if(results[0] == 0):
|
if(results[0] == 0):
|
||||||
conn.execute("create table if not exists "+ \
|
conn.execute("create table if not exists "+ \
|
||||||
"seen(name varchar(50), date datetime, quote varchar(250), chan varchar(50),"+ \
|
"seen(name varchar(50) not null, date datetime not null, "+ \
|
||||||
|
"quote varchar(250) not null, chan varchar(50) not null, "+ \
|
||||||
"primary key(name, chan));")
|
"primary key(name, chan));")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,9 @@ def dbconnect(db):
|
||||||
|
|
||||||
if results[0] == 0:
|
if results[0] == 0:
|
||||||
conn.execute("create table if not exists "+ \
|
conn.execute("create table if not exists "+ \
|
||||||
"tell(id integer primary key autoincrement, name varchar(50), user_from varchar(50), "+ \
|
"tell(id integer primary key autoincrement, name varchar(50) not null, "+ \
|
||||||
" quote varchar(250), chan varchar(50), date datetime);")
|
"user_from varchar(50) not null, quote varchar(250) not null, "+ \
|
||||||
|
"chan varchar(50) not null, date datetime not null);")
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
@ -92,7 +93,7 @@ def dbconnect(db):
|
||||||
if results[0] == 0:
|
if results[0] == 0:
|
||||||
conn.execute("create table if not exists "+ \
|
conn.execute("create table if not exists "+ \
|
||||||
"tell_probation(name varchar(50), chan varchar(50),"+ \
|
"tell_probation(name varchar(50), chan varchar(50),"+ \
|
||||||
"primary key(name));")
|
"primary key(name, chan));")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
return conn
|
return conn
|
||||||
|
|
Loading…
Reference in New Issue