From 7f29882ebfba280ede8f30293360067a3a8a0c0a Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 15 Sep 2022 21:11:50 +0800 Subject: [PATCH] chore: update seeding data --- store/db/seed/10001__user.sql | 24 +++++++++-- store/db/seed/10002__workspace.sql | 17 +++++++- store/db/seed/10003__workspace_user.sql | 26 +++++++++++ store/db/seed/10004__shortcut.sql | 57 +++++++++++++++++++++++++ web/src/pages/Auth.tsx | 2 +- 5 files changed, 121 insertions(+), 5 deletions(-) diff --git a/store/db/seed/10001__user.sql b/store/db/seed/10001__user.sql index ed4074d..baee47e 100644 --- a/store/db/seed/10001__user.sql +++ b/store/db/seed/10001__user.sql @@ -9,9 +9,27 @@ INSERT INTO VALUES ( 101, - 'demo@iamcorgi.com', - 'Demo Host', + 'frank@iamcorgi.com', + 'Frank', -- raw password: secret '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK', - 'demo_open_id' + 'frank_open_id' + ); + +INSERT INTO + user ( + `id`, + `email`, + `name`, + `password_hash`, + `open_id` + ) +VALUES + ( + 102, + 'bob@iamcorgi.com', + 'Bob', + -- raw password: secret + '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK', + 'bob_open_id' ); diff --git a/store/db/seed/10002__workspace.sql b/store/db/seed/10002__workspace.sql index 09e6950..1df73a6 100644 --- a/store/db/seed/10002__workspace.sql +++ b/store/db/seed/10002__workspace.sql @@ -9,6 +9,21 @@ VALUES ( 11, 101, - 'demo', + 'minecraft', + '' + ); + +INSERT INTO + workspace ( + `id`, + `creator_id`, + `name`, + `description` + ) +VALUES + ( + 12, + 102, + 'bob-room', '' ); diff --git a/store/db/seed/10003__workspace_user.sql b/store/db/seed/10003__workspace_user.sql index 599c5b2..e6e6963 100644 --- a/store/db/seed/10003__workspace_user.sql +++ b/store/db/seed/10003__workspace_user.sql @@ -10,3 +10,29 @@ VALUES 101, 'ADMIN' ); + +INSERT INTO + workspace_user ( + `workspace_id`, + `user_id`, + `role` + ) +VALUES + ( + 12, + 102, + 'ADMIN' + ); + +INSERT INTO + workspace_user ( + `workspace_id`, + `user_id`, + `role` + ) +VALUES + ( + 12, + 101, + 'USER' + ); diff --git a/store/db/seed/10004__shortcut.sql b/store/db/seed/10004__shortcut.sql index 43d0fa6..e08dfa1 100644 --- a/store/db/seed/10004__shortcut.sql +++ b/store/db/seed/10004__shortcut.sql @@ -35,3 +35,60 @@ VALUES 'B站', 'PUBLIC' ); + +INSERT INTO + shortcut ( + `creator_id`, + `workspace_id`, + `name`, + `link`, + `description`, + `visibility` + ) +VALUES + ( + 101, + 11, + 'ph', + 'https://producthunt.com', + 'PH', + 'PRIVATE' + ); + +INSERT INTO + shortcut ( + `creator_id`, + `workspace_id`, + `name`, + `link`, + `description`, + `visibility` + ) +VALUES + ( + 101, + 12, + 'github', + 'https://producthunt.com', + 'GitHub', + 'PRIVATE' + ); + +INSERT INTO + shortcut ( + `creator_id`, + `workspace_id`, + `name`, + `link`, + `description`, + `visibility` + ) +VALUES + ( + 102, + 12, + 'go', + 'https://google.com', + 'google', + 'WORKSPACE' + ); diff --git a/web/src/pages/Auth.tsx b/web/src/pages/Auth.tsx index aaabeb7..a2790c9 100644 --- a/web/src/pages/Auth.tsx +++ b/web/src/pages/Auth.tsx @@ -30,7 +30,7 @@ const Auth: React.FC = () => { api.getSystemStatus().then(({ data }) => { const { data: status } = data; if (status.profile.mode === "dev") { - setEmail("demo@iamcorgi.com"); + setEmail("frank@iamcorgi.com"); setPassword("secret"); } });