-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
is: Add user console preferences migration
- Loading branch information
1 parent
012d0d9
commit 914a946
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
pkg/identityserver/store/migrations/20240103000001_console_preferences.down.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,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'; |
16 changes: 16 additions & 0 deletions
16
pkg/identityserver/store/migrations/20240103000001_console_preferences.up.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,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'; |