diff --git a/testing/gen-database.py b/testing/gen-database.py index 53cc7c44c..2d73c678a 100755 --- a/testing/gen-database.py +++ b/testing/gen-database.py @@ -2,6 +2,7 @@ import sqlite3 from faker import Faker +import random conn = sqlite3.connect('database.db') cursor = conn.cursor() @@ -17,7 +18,8 @@ cursor.execute(''' address TEXT, city TEXT, state TEXT, - zipcode TEXT + zipcode TEXT, + age INTEGER ) ''') @@ -31,11 +33,14 @@ for _ in range(10000): city = fake.city() state = fake.state_abbr() zipcode = fake.zipcode() + age = random.randint(0, 100) % 99 cursor.execute(''' - INSERT INTO users (first_name, last_name, email, phone_number, address, city, state, zipcode) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) - ''', (first_name, last_name, email, phone_number, address, city, state, zipcode)) + INSERT INTO users (first_name, last_name, email, phone_number, address, city, state, zipcode, age) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) + ''', (first_name, last_name, email, phone_number, address, city, state, zipcode, age)) + + conn.commit() conn.close()