Browse Source

Fix seeds

Eren Yilmaz 6 years ago
parent
commit
3d9c62f820
1 changed files with 2 additions and 2 deletions
  1. 2 2
      db_setup.py

+ 2 - 2
db_setup.py

@@ -1,7 +1,7 @@
 from game import CURRENCY_NAME, MINIMUM_ORDER_AMOUNT
 
 
-def setup(cursor, seed_tables=False):
+def setup(cursor):
     print('Database setup...')
 
     drop_triggers(cursor)
@@ -72,7 +72,7 @@ def seed(cursor):
 
     # bank owns all the money that is not owned by players, 1000 * num_used_key - player_money
     cursor.execute('''
-                    INSERT INTO ownership
+                    INSERT OR IGNORE INTO ownership
                     (user_id, ownable_id, amount)
                     VALUES ((SELECT rowid FROM users WHERE username = 'bank'), 
                             (SELECT rowid FROM ownables WHERE name = ?),