From bea633782b4e244e90e444b1e8628eaa170eabbe Mon Sep 17 00:00:00 2001 From: klafyvel Date: Sat, 20 Jan 2018 02:03:25 +0100 Subject: [PATCH] Import de bdd plus mieux. --- import_bdd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/import_bdd.py b/import_bdd.py index 0746318..be6b3bb 100755 --- a/import_bdd.py +++ b/import_bdd.py @@ -16,13 +16,13 @@ def process(): cur.execute('''drop table if exists players''') cur.execute('''drop table if exists machines''') print("create tables") - cur.execute('''create table players (id int,firstname text,name text, ban_end float)''') - cur.execute('''create table machines (id int,player_id int,ip text)''') + cur.execute('''create table players (id integer primary key auto_increment,firstname text not null,name text not null, ban_end double not null)''') + cur.execute('''create table machines (id int primary key auto_increment,player_id int not null,ip text not null)''') print("select players") cur.execute("""select id from players""") players = cur.fetchall() players = [player[0] for player in players] - + print("select machines") cur.execute("""select ip from machines""") machines = cur.fetchall()