Skip to content

Commit 96855a2

Browse files
committed
added is_fake column for test data
1 parent 4d9cee3 commit 96855a2

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- +goose Up
2+
alter table users add column is_fake boolean not null default false;
3+
alter table applications add column is_fake boolean not null default false;
4+
5+
-- +goose Down
6+
alter table users drop column is_fake;
7+
alter table applications drop column is_fake;

‎scripts/db-data-generator/src/applications-generator.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def generate_application(user_id: str, hackathon_id: str) -> dict:
111111
"updated_at": updated_at,
112112
"submitted_at": submitted_at,
113113
"hackathon_id": hackathon_id,
114+
"is_fake": True
114115
}
115116

116117

@@ -123,6 +124,7 @@ def generate_application(user_id: str, hackathon_id: str) -> dict:
123124
"updated_at",
124125
"submitted_at",
125126
"hackathon_id",
127+
"is_fake"
126128
]
127129

128130

@@ -132,7 +134,7 @@ def insert_applications(conn, applications: list[dict]):
132134
# to know about the custom enum type ahead of time.
133135
template = (
134136
"(%(user_id)s, %(status)s::application_status, %(application)s, %(created_at)s, "
135-
"%(saved_at)s, %(updated_at)s, %(submitted_at)s, %(hackathon_id)s)"
137+
"%(saved_at)s, %(updated_at)s, %(submitted_at)s, %(hackathon_id)s, %(is_fake)s)"
136138
)
137139

138140
query = f"INSERT INTO applications ({', '.join(COLUMNS)}) VALUES %s"

‎scripts/db-data-generator/src/users-generator.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def generate_user(existing_emails: set) -> dict:
9494
"rfid": rfid,
9595
"role_assigned_at": role_assigned_at,
9696
"role": role,
97+
"is_fake": True
9798
}
9899

99100

@@ -112,6 +113,7 @@ def generate_user(existing_emails: set) -> dict:
112113
"rfid",
113114
"role_assigned_at",
114115
"role",
116+
"is_fake"
115117
]
116118

117119

@@ -124,7 +126,7 @@ def insert_users(conn, users: list[dict]):
124126
template = (
125127
"(%(id)s, %(name)s, %(email)s, %(email_verified)s, %(onboarded)s, %(image)s, "
126128
"%(created_at)s, %(updated_at)s, %(preferred_email)s, %(email_consent)s, "
127-
"%(checked_in_at)s, %(rfid)s, %(role_assigned_at)s, %(role)s::user_role)"
129+
"%(checked_in_at)s, %(rfid)s, %(role_assigned_at)s, %(role)s::user_role, %(is_fake)s)"
128130
)
129131

130132
query = f"INSERT INTO users ({', '.join(COLUMNS)}) VALUES %s"

0 commit comments

Comments
 (0)