From b0d64bee00bf95a74ab041563e5eb11970b6c60e Mon Sep 17 00:00:00 2001 From: Marius Sandu-Popa Date: Sat, 24 Oct 2009 06:03:18 +0300 Subject: [PATCH] added triggers for fk --- auto/bd/build_db | 22 +++++++++++----------- auto/sql/p2p-log-sqlite.sql | 4 +++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/auto/bd/build_db b/auto/bd/build_db index 11fae4a..17326ef 100755 --- a/auto/bd/build_db +++ b/auto/bd/build_db @@ -66,15 +66,15 @@ curs.execute('''create table verbose_messages ( listen_port integer check(listen_port between 1 and 65535) )''') -for t in [('1', 'mumu', '1024', 'ceva', 'URL'), - ('2', 'gugu', '1024', 'ceva', 'URL'), - ('3', 'gaga', '1024', 'ceva', 'URL'), - ]: - curs.execute('insert into swarms values (?,?,?,?,?)', t) -conn.commit() +#for t in [('1', 'mumu', '1024', 'ceva', 'URL'), +# ('2', 'gugu', '1024', 'ceva', 'URL'), +# ('3', 'gaga', '1024', 'ceva', 'URL'), +# ]: +# curs.execute('insert into swarms values (?,?,?,?,?)', t) +#conn.commit() -curs.execute('select * from swarms') -for row in curs: - print row - -conn.close() \ No newline at end of file +#curs.execute('select * from swarms') +#for row in curs: +# print row +# +#conn.close() \ No newline at end of file diff --git a/auto/sql/p2p-log-sqlite.sql b/auto/sql/p2p-log-sqlite.sql index 29843b6..81af91c 100644 --- a/auto/sql/p2p-log-sqlite.sql +++ b/auto/sql/p2p-log-sqlite.sql @@ -46,10 +46,12 @@ create table status_messages ( create table verbose_messages ( cs_id integer references client_session(id), timestamp date, - peer_ip integer, + peer_ip text, peer_port integer check(peer_port between 1 and 65535), message_type integer, _index integer, begin integer, length integer, listen_port integer check(listen_port between 1 and 65535)); + +.genfkey --exec \ No newline at end of file -- 2.20.1