Update database.py
Browse files- database.py +3 -3
database.py
CHANGED
|
@@ -31,10 +31,10 @@ def init_db(app):
|
|
| 31 |
CREATE TABLE IF NOT EXISTS users (
|
| 32 |
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
| 33 |
udid TEXT NOT NULL UNIQUE,
|
| 34 |
-
name TEXT DEFAULT
|
| 35 |
premium_account BOOLEAN DEFAULT FALSE,
|
| 36 |
usage_limit INTEGER DEFAULT 10,
|
| 37 |
-
invoice TEXT DEFAULT
|
| 38 |
)
|
| 39 |
''')
|
| 40 |
|
|
@@ -42,6 +42,6 @@ def init_db(app):
|
|
| 42 |
if cursor.fetchone()[0] == 0:
|
| 43 |
cursor.executemany('INSERT INTO users (udid, name, premium_account, usage_limit, invoice) VALUES (?, ?, ?, ?, ?)',
|
| 44 |
[('test_udid_1', 'Test User 1', True, 4, 'test_invoice_1'),
|
| 45 |
-
('test_udid_2', 'Test User 2', False, 4,
|
| 46 |
|
| 47 |
db.commit()
|
|
|
|
| 31 |
CREATE TABLE IF NOT EXISTS users (
|
| 32 |
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
| 33 |
udid TEXT NOT NULL UNIQUE,
|
| 34 |
+
name TEXT DEFAULT '',
|
| 35 |
premium_account BOOLEAN DEFAULT FALSE,
|
| 36 |
usage_limit INTEGER DEFAULT 10,
|
| 37 |
+
invoice TEXT DEFAULT ''
|
| 38 |
)
|
| 39 |
''')
|
| 40 |
|
|
|
|
| 42 |
if cursor.fetchone()[0] == 0:
|
| 43 |
cursor.executemany('INSERT INTO users (udid, name, premium_account, usage_limit, invoice) VALUES (?, ?, ?, ?, ?)',
|
| 44 |
[('test_udid_1', 'Test User 1', True, 4, 'test_invoice_1'),
|
| 45 |
+
('test_udid_2', 'Test User 2', False, 4, 'test_invoice_2')])
|
| 46 |
|
| 47 |
db.commit()
|