Browse Source

Fix seeds

Eren Yilmaz 6 năm trước cách đây
mục cha
commit
3d9c62f820
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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 = ?),