-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add onboarding_a column to onboarding table (#1340)
#1338 <img width="1215" alt="Screenshot 2023-10-05 at 18 05 30" src="https://github.com/StanGirard/quivr/assets/63923024/67562c50-ddc1-4eaa-8b68-d374b2eb4b67">
- Loading branch information
1 parent
f13f08c
commit 16cea2c
Showing
8 changed files
with
56 additions
and
34 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
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
-- Create the onboarding table | ||
CREATE TABLE IF NOT EXISTS onboardings ( | ||
user_id UUID NOT NULL REFERENCES auth.users (id), | ||
onboarding_b1 BOOLEAN NOT NULL DEFAULT false, | ||
onboarding_b2 BOOLEAN NOT NULL DEFAULT false, | ||
onboarding_b3 BOOLEAN NOT NULL DEFAULT false, | ||
onboarding_b1 BOOLEAN NOT NULL DEFAULT true, | ||
onboarding_b2 BOOLEAN NOT NULL DEFAULT true, | ||
onboarding_b3 BOOLEAN NOT NULL DEFAULT true, | ||
PRIMARY KEY (user_id) | ||
) |
17 changes: 17 additions & 0 deletions
17
scripts/20231005170000_add_onboarding_a_to_onboarding_table.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,17 @@ | ||
-- Check if onboarding_a column exists | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'onboardings' AND column_name = 'onboarding_a') THEN | ||
ALTER TABLE onboardings ADD COLUMN onboarding_a BOOLEAN NOT NULL DEFAULT true; | ||
END IF; | ||
END $$; | ||
|
||
COMMIT; | ||
|
||
|
||
-- Update migrations table | ||
INSERT INTO migrations (name) | ||
SELECT '20231005170000_add_onboarding_a_to_onboarding_table' | ||
WHERE NOT EXISTS ( | ||
SELECT 1 FROM migrations WHERE name = '20231005170000_add_onboarding_a_to_onboarding_table' | ||
); |
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