.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):
|
||||
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));")
|
||||
conn.commit()
|
||||
|
||||
|
|
|
@ -83,8 +83,9 @@ def dbconnect(db):
|
|||
|
||||
if results[0] == 0:
|
||||
conn.execute("create table if not exists "+ \
|
||||
"tell(id integer primary key autoincrement, name varchar(50), user_from varchar(50), "+ \
|
||||
" quote varchar(250), chan varchar(50), date datetime);")
|
||||
"tell(id integer primary key autoincrement, name varchar(50) not null, "+ \
|
||||
"user_from varchar(50) not null, quote varchar(250) not null, "+ \
|
||||
"chan varchar(50) not null, date datetime not null);")
|
||||
|
||||
conn.commit()
|
||||
|
||||
|
@ -92,7 +93,7 @@ def dbconnect(db):
|
|||
if results[0] == 0:
|
||||
conn.execute("create table if not exists "+ \
|
||||
"tell_probation(name varchar(50), chan varchar(50),"+ \
|
||||
"primary key(name));")
|
||||
"primary key(name, chan));")
|
||||
conn.commit()
|
||||
|
||||
return conn
|
||||
|
|
Loading…
Reference in New Issue