-
Notifications
You must be signed in to change notification settings - Fork 3.7k
update KeyValuePairType enum and add IS_CONFIG_VAR_IN_DB_ENABLED config var #11476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e556261
change system_var to config_variable and user_var to user_variable an…
ehconitin 3ad7cb2
add IS_CONFIG_VAR_IN_DB_ENABLED
ehconitin 1f0a9a6
Merge remote-tracking branch 'upstream/main' into config-prep-2
ehconitin f61b830
lint
ehconitin b671d96
Merge remote-tracking branch 'upstream/main' into config-prep-2
ehconitin e58ef31
rename service spec
ehconitin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
69 changes: 69 additions & 0 deletions
69
...r/src/database/typeorm/core/migrations/common/1743085000787-updateKeyValuePairTypeEnum.ts
This file contains hidden or 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,69 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class UpdateKeyValuePairTypeEnum1743085000787 | ||
implements MigrationInterface | ||
{ | ||
name = 'UpdateKeyValuePairTypeEnum1743085000787'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" DROP DEFAULT`, | ||
); | ||
|
||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" TYPE text USING "type"::text`, | ||
); | ||
|
||
await queryRunner.query( | ||
`UPDATE "core"."keyValuePair" SET "type" = 'USER_VARIABLE' WHERE "type" = 'USER_VAR'`, | ||
); | ||
await queryRunner.query( | ||
`UPDATE "core"."keyValuePair" SET "type" = 'CONFIG_VARIABLE' WHERE "type" = 'SYSTEM_VAR'`, | ||
); | ||
|
||
await queryRunner.query(`DROP TYPE "core"."keyValuePair_type_enum"`); | ||
|
||
await queryRunner.query( | ||
`CREATE TYPE "core"."keyValuePair_type_enum" AS ENUM('USER_VARIABLE', 'FEATURE_FLAG', 'CONFIG_VARIABLE')`, | ||
); | ||
|
||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" TYPE "core"."keyValuePair_type_enum" USING "type"::"core"."keyValuePair_type_enum"`, | ||
); | ||
|
||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" SET DEFAULT 'USER_VARIABLE'`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" DROP DEFAULT`, | ||
); | ||
|
||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" TYPE text USING "type"::text`, | ||
); | ||
|
||
await queryRunner.query( | ||
`UPDATE "core"."keyValuePair" SET "type" = 'USER_VAR' WHERE "type" = 'USER_VARIABLE'`, | ||
); | ||
await queryRunner.query( | ||
`UPDATE "core"."keyValuePair" SET "type" = 'SYSTEM_VAR' WHERE "type" = 'CONFIG_VARIABLE'`, | ||
); | ||
|
||
await queryRunner.query(`DROP TYPE "core"."keyValuePair_type_enum"`); | ||
|
||
await queryRunner.query( | ||
`CREATE TYPE "core"."keyValuePair_type_enum" AS ENUM('USER_VAR', 'FEATURE_FLAG', 'SYSTEM_VAR')`, | ||
); | ||
|
||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" TYPE "core"."keyValuePair_type_enum" USING "type"::"core"."keyValuePair_type_enum"`, | ||
); | ||
|
||
await queryRunner.query( | ||
`ALTER TABLE "core"."keyValuePair" ALTER COLUMN "type" SET DEFAULT 'USER_VAR'`, | ||
); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.