From: Marius Sandu-Popa Date: Sat, 24 Oct 2009 03:03:18 +0000 (+0300) Subject: added triggers for fk X-Git-Tag: getopt_long~297 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=b0d64bee00bf95a74ab041563e5eb11970b6c60e;p=cs-p2p-next.git added triggers for fk --- 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