.seen and .tell: add some constraints on columns.

This commit is contained in:
Chris Skalenda 2009-07-05 10:52:00 -05:00
parent ba3d706b39
commit 92b00e7cad
2 changed files with 6 additions and 4 deletions

View File

@ -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()

View File

@ -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