-
-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
40 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
packages/schemas/alterations/next-1730712629-add-is-visible-for-applications-table.ts
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/schemas/alterations/next-1730712629-update-application-type.ts
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,30 @@ | ||
import { sql } from '@silverhand/slonik'; | ||
|
||
import type { AlterationScript } from '../lib/types/alteration.js'; | ||
|
||
const alteration: AlterationScript = { | ||
up: async (pool) => { | ||
await pool.query(sql` | ||
alter type application_type add value if not exists 'SAML'; | ||
`); | ||
}, | ||
down: async (pool) => { | ||
await pool.query(sql` | ||
delete from applications where type = 'SAML'; | ||
`); | ||
|
||
await pool.query(sql` | ||
create type application_type_new as enum ('Native', 'SPA', 'Traditional', 'MachineToMachine', 'Protected'); | ||
alter table applications | ||
alter column type type application_type_new | ||
using type::text::application_type_new; | ||
drop type application_type; | ||
alter type application_type_new rename to application_type; | ||
`); | ||
}, | ||
}; | ||
|
||
export default alteration; |
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