Skip to content

Commit

Permalink
is: Add user console preferences migration
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspcr committed Mar 4, 2024
1 parent 012d0d9 commit 914a946
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ALTER TABLE users DROP COLUMN IF EXISTS console_preferences CASCADE;

--bun:split
CREATE OR REPLACE VIEW user_accounts AS
SELECT
acc.id AS account_id,
acc.created_at AS account_created_at,
acc.updated_at AS account_updated_at,
acc.deleted_at AS account_deleted_at,
acc.uid AS account_uid,
usr.*
FROM
accounts acc
JOIN users usr ON usr.id = acc.account_id
AND acc.account_type = 'user';
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ALTER TABLE users
ADD COLUMN IF NOT EXISTS console_preferences bytea;

--bun:split
CREATE OR REPLACE VIEW user_accounts AS
SELECT
acc.id AS account_id,
acc.created_at AS account_created_at,
acc.updated_at AS account_updated_at,
acc.deleted_at AS account_deleted_at,
acc.uid AS account_uid,
usr.*
FROM
accounts acc
JOIN users usr ON usr.id = acc.account_id
AND acc.account_type = 'user';

0 comments on commit 914a946

Please sign in to comment.