-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,159 additions
and
1,020 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
insert into "user" (id, created_at) | ||
values ('1f241e1b-b537-493f-a230-075cb16315be', '2020-08-08T00:11:21Z'::timestamptz), -- user 0: complete admin, used for general API testing | ||
values ('1f241e1b-b537-493f-a230-075cb16315be', '2020-08-09T00:11:21Z'::timestamptz), -- user 0: complete admin, used for general API testing | ||
('7b96a41c-e406-11eb-8176-efd86dd7f444', '2020-08-08T00:11:21Z'::timestamptz), -- user 1: incomplete user, needs profile to complete registration | ||
('a641fd6e-e41b-11eb-8176-57df101c2201', now()); -- user 2: registering user, needs email verification | ||
('a641fd6e-e41b-11eb-8176-57df101c2201', '2020-08-07T00:11:21Z'::timestamptz); -- user 2: registering user, needs email verification | ||
|
||
insert into user_email (user_id, email, created_at) | ||
values ('1f241e1b-b537-493f-a230-075cb16315be', '[email protected]', '2020-08-08T00:11:21Z'::timestamptz), | ||
('7b96a41c-e406-11eb-8176-efd86dd7f444', '[email protected]', '2020-08-08T00:11:21Z'::timestamptz); | ||
values ('1f241e1b-b537-493f-a230-075cb16315be', '[email protected]', '2020-08-09T00:11:21Z'::timestamptz), | ||
('7b96a41c-e406-11eb-8176-efd86dd7f444', '[email protected]', '2020-08-08T00:11:21Z'::timestamptz), | ||
('a641fd6e-e41b-11eb-8176-57df101c2201', '[email protected]', '2020-08-07T00:11:21Z'::timestamptz); | ||
|
||
-- password is 'password1' | ||
insert into "user_auth_basic" (user_id, email, password) values ('1f241e1b-b537-493f-a230-075cb16315be', '[email protected]', '$argon2id$v=19$m=8192,t=16,p=1$3f60oO10WmwVJ9MIFf1f6w$CcjLqbHaDP7cJXAut6S9cmgGg6NL2Jsg++aIpdvmaBg'), -- 0 | ||
|
@@ -19,13 +20,13 @@ insert into "session" (user_id, token, scope_mask) values ('1f241e1b-b537-493f-a | |
('a641fd6e-e41b-11eb-8176-57df101c2201', 'L6gfXvgZeUBt8pdmLBnsGPEWUe3qGCK2_DF', 4); -- user 2 | ||
|
||
insert into "user_profile" (user_id, username, created_at, given_name, family_name, languages_spoken, | ||
opt_into_edu_resources, over_18, timezone, organization, languages_spoken_public, organization_public) | ||
opt_into_edu_resources, over_18, timezone, organization, languages_spoken_public, organization_public, badge) | ||
values ('1f241e1b-b537-493f-a230-075cb16315be', 'test', | ||
'2020-08-08T00:11:21Z'::timestamptz, 'Bobby', 'Tables', '{en_US}', true, true, 'US/Pacific', 'test org', false, true), | ||
'2020-08-08T00:11:21Z'::timestamptz, 'Bobby', 'Tables', '{en_US}', true, true, 'US/Pacific', 'test org', false, true, 1), | ||
('7b96a41c-e406-11eb-8176-efd86dd7f444', 'test1', | ||
'2020-08-08T00:11:21Z'::timestamptz, 'Post', 'Gres', '{en_US}', true, true, 'US/Pacific', 'test1 org', true, true), | ||
'2020-08-08T00:11:21Z'::timestamptz, 'Post', 'Gres', '{en_US}', true, true, 'US/Pacific', 'test1 org', true, true, 0), | ||
('a641fd6e-e41b-11eb-8176-57df101c2201', 'test2', | ||
'2020-08-08T00:11:21Z'::timestamptz, 'Scrappy', 'Doo', '{en_US}', true, true, 'US/Pacific', 'test2 org', false, true); | ||
'2020-08-08T00:11:21Z'::timestamptz, 'Scrappy', 'Doo', '{en_US}', true, true, 'US/Pacific', 'test2 org', false, true, 10); | ||
|
||
-- 1 is "Admin" | ||
insert into "user_scope" (user_id, scope) | ||
|
9 changes: 9 additions & 0 deletions
9
backend/api/migrations/20230718025450_no_badge_user_profile.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- set no badge users | ||
|
||
update user_profile | ||
set badge = 10 | ||
where badge is null; | ||
|
||
alter table user_profile | ||
alter column badge set default 10, | ||
alter column badge set not null; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
backend/api/tests/integration/snapshots/integration__user__browse_user_badges-1.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
source: tests/integration/user.rs | ||
expression: body | ||
--- | ||
{ | ||
"users": [ | ||
{ | ||
"id": "a641fd6e-e41b-11eb-8176-57df101c2201", | ||
"username": "test2", | ||
"givenName": "Scrappy", | ||
"familyName": "Doo", | ||
"email": "[email protected]", | ||
"country": null, | ||
"state": null, | ||
"city": null, | ||
"organization": "test2 org", | ||
"createdAt": "2020-08-07", | ||
"language": "en", | ||
"badge": null | ||
} | ||
], | ||
"pages": 1, | ||
"totalUserCount": 1 | ||
} |
24 changes: 24 additions & 0 deletions
24
backend/api/tests/integration/snapshots/integration__user__browse_user_badges-2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
source: tests/integration/user.rs | ||
expression: body | ||
--- | ||
{ | ||
"users": [ | ||
{ | ||
"id": "1f241e1b-b537-493f-a230-075cb16315be", | ||
"username": "test", | ||
"givenName": "Bobby", | ||
"familyName": "Tables", | ||
"email": "[email protected]", | ||
"country": null, | ||
"state": null, | ||
"city": null, | ||
"organization": "test org", | ||
"createdAt": "2020-08-09", | ||
"language": "en", | ||
"badge": "jiTeam" | ||
} | ||
], | ||
"pages": 1, | ||
"totalUserCount": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.