Add migrations/002_schema_updates.sql for terms_agreed, streak_count, and pdf_url
This commit is contained in:
10
migrations/002_schema_updates.sql
Normal file
10
migrations/002_schema_updates.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
-- Schema Updates: terms_agreed, pdf_url, streaks
|
||||||
|
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS terms_agreed BOOLEAN DEFAULT FALSE;
|
||||||
|
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS streak_count INTEGER NOT NULL DEFAULT 0;
|
||||||
|
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS longest_streak INTEGER NOT NULL DEFAULT 0;
|
||||||
|
ALTER TABLE "user" ADD COLUMN IF NOT EXISTS is_active BOOLEAN DEFAULT TRUE;
|
||||||
|
|
||||||
|
ALTER TABLE "test" ADD COLUMN IF NOT EXISTS pdf_url VARCHAR;
|
||||||
|
|
||||||
|
-- Update existing streaks to have default 1 if empty
|
||||||
|
UPDATE "user" SET streak_count = 1, longest_streak = 1 WHERE streak_count = 0;
|
||||||
Reference in New Issue
Block a user