|
692 | 692 | ],
|
693 | 693 | "IsCreateIndexConcurrently": false,
|
694 | 694 | "IndexMetadata": null
|
| 695 | + }, |
| 696 | + { |
| 697 | + "ID": 1719914228, |
| 698 | + "Name": "insight_series_modify_query", |
| 699 | + "UpQuery": "ALTER TABLE insight_series ADD COLUMN IF NOT EXISTS query_old TEXT;\nUPDATE insight_series SET query_old = query;\n\n-- prefix query with patternType:standard if there is no patterntype: in the query\nUPDATE insight_series\nSET query = 'patterntype:standard ' || query\nWHERE query NOT ILIKE '%patterntype:%'\n -- exclude empty queries, which are created by language stats insights\n AND query != '';\n\nCOMMENT ON COLUMN insight_series.query_old IS 'Backup for migration. Remove with release 5.6 or later.';", |
| 700 | + "DownQuery": "DO\n$$\n BEGIN\n -- Check if column 'query_old' exists\n IF EXISTS (SELECT 1\n FROM information_schema.columns\n WHERE table_name = 'insight_series' AND column_name = 'query_old') THEN\n -- Update the 'query' column with values from 'query_old'\n UPDATE insight_series SET query = query_old;\n ALTER TABLE insight_series DROP COLUMN query_old;\n END IF;\n END\n$$;", |
| 701 | + "Privileged": false, |
| 702 | + "NonIdempotent": false, |
| 703 | + "Parents": [ |
| 704 | + 1679051112 |
| 705 | + ], |
| 706 | + "IsCreateIndexConcurrently": false, |
| 707 | + "IndexMetadata": null |
695 | 708 | }
|
696 | 709 | ],
|
697 | 710 | "BoundsByRev": {
|
|
933 | 946 | 1679051112
|
934 | 947 | ],
|
935 | 948 | "PreCreation": false
|
| 949 | + }, |
| 950 | + "v5.5.0": { |
| 951 | + "RootID": 1000000027, |
| 952 | + "LeafIDs": [ |
| 953 | + 1719914228 |
| 954 | + ], |
| 955 | + "PreCreation": false |
936 | 956 | }
|
937 | 957 | }
|
938 | 958 | },
|
|
1909 | 1929 | 1686315964
|
1910 | 1930 | ],
|
1911 | 1931 | "PreCreation": false
|
| 1932 | + }, |
| 1933 | + "v5.5.0": { |
| 1934 | + "RootID": 1000000033, |
| 1935 | + "LeafIDs": [ |
| 1936 | + 1686315964 |
| 1937 | + ], |
| 1938 | + "PreCreation": false |
1912 | 1939 | }
|
1913 | 1940 | }
|
1914 | 1941 | },
|
|
11221 | 11248 | ],
|
11222 | 11249 | "IsCreateIndexConcurrently": false,
|
11223 | 11250 | "IndexMetadata": null
|
| 11251 | + }, |
| 11252 | + { |
| 11253 | + "ID": 1717699555, |
| 11254 | + "Name": "Fix unique index for SCIM external account connection", |
| 11255 | + "UpQuery": "DROP INDEX IF EXISTS user_external_accounts_user_id_scim_service_type;\n\nCREATE UNIQUE INDEX\n user_external_accounts_user_id_scim_service_type\nON\n user_external_accounts (user_id, service_type)\nWHERE\n service_type = 'scim'::text\n AND deleted_at IS NULL;", |
| 11256 | + "DownQuery": "DROP INDEX IF EXISTS user_external_accounts_user_id_scim_service_type;\n\nCREATE UNIQUE INDEX\n user_external_accounts_user_id_scim_service_type\nON\n user_external_accounts (user_id, service_type)\nWHERE\n service_type = 'scim'::text;", |
| 11257 | + "Privileged": false, |
| 11258 | + "NonIdempotent": false, |
| 11259 | + "Parents": [ |
| 11260 | + 1713958707 |
| 11261 | + ], |
| 11262 | + "IsCreateIndexConcurrently": false, |
| 11263 | + "IndexMetadata": null |
| 11264 | + }, |
| 11265 | + { |
| 11266 | + "ID": 1719214941, |
| 11267 | + "Name": "notebooks_add_field_pattern_type", |
| 11268 | + "UpQuery": "DO $$\nBEGIN\n IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'pattern_type') THEN\n CREATE TYPE pattern_type AS ENUM ('keyword', 'literal', 'regexp', 'standard', 'structural');\n END IF;\nEND\n$$;\n\nALTER TABLE notebooks ADD COLUMN IF NOT EXISTS pattern_type pattern_type NOT NULL DEFAULT 'standard';", |
| 11269 | + "DownQuery": "ALTER TABLE notebooks DROP COLUMN IF EXISTS pattern_type;\nDROP TYPE IF EXISTS pattern_type;", |
| 11270 | + "Privileged": false, |
| 11271 | + "NonIdempotent": false, |
| 11272 | + "Parents": [ |
| 11273 | + 1717699555 |
| 11274 | + ], |
| 11275 | + "IsCreateIndexConcurrently": false, |
| 11276 | + "IndexMetadata": null |
| 11277 | + }, |
| 11278 | + { |
| 11279 | + "ID": 1719498032, |
| 11280 | + "Name": "add_github_app_batch_changes_site_credential", |
| 11281 | + "UpQuery": "ALTER TABLE IF EXISTS batch_changes_site_credentials\n ADD COLUMN IF NOT EXISTS github_app_id INT NULL REFERENCES github_apps(id) ON DELETE CASCADE;\n\nALTER TABLE batch_changes_site_credentials DROP CONSTRAINT IF EXISTS check_github_app_id_and_external_service_type_site_credentials;\n\n-- We want to make sure that we never have a site_credential with a `github_app_id` with an `external_service_type`\n-- that isn't `github`.\nALTER TABLE IF EXISTS batch_changes_site_credentials\n ADD CONSTRAINT check_github_app_id_and_external_service_type_site_credentials\n CHECK ((github_app_id IS NULL) OR (external_service_type = 'github'));", |
| 11282 | + "DownQuery": "-- delete the constraints\nALTER TABLE IF EXISTS batch_changes_site_credentials DROP CONSTRAINT IF EXISTS check_github_app_id_and_external_service_type_site_credentials;\n\n-- delete the `github_app_id` column\nALTER TABLE IF EXISTS batch_changes_site_credentials DROP COLUMN IF EXISTS github_app_id;", |
| 11283 | + "Privileged": false, |
| 11284 | + "NonIdempotent": false, |
| 11285 | + "Parents": [ |
| 11286 | + 1717699555 |
| 11287 | + ], |
| 11288 | + "IsCreateIndexConcurrently": false, |
| 11289 | + "IndexMetadata": null |
| 11290 | + }, |
| 11291 | + { |
| 11292 | + "ID": 1719498091, |
| 11293 | + "Name": "add_github_app_id_user_credentials", |
| 11294 | + "UpQuery": "ALTER TABLE IF EXISTS user_credentials\n ADD COLUMN IF NOT EXISTS github_app_id INT NULL REFERENCES github_apps(id) ON DELETE CASCADE;\n\nALTER TABLE user_credentials DROP CONSTRAINT IF EXISTS check_github_app_id_and_external_service_type_user_credentials;\n\n-- We want to make sure that we never have a user_credential with a `github_app_id` with an `external_service_type`\n-- that isn't `github`.\nALTER TABLE IF EXISTS user_credentials\n ADD CONSTRAINT check_github_app_id_and_external_service_type_user_credentials\n CHECK ((github_app_id IS NULL) OR (external_service_type = 'github'));", |
| 11295 | + "DownQuery": "-- delete the constraints\nALTER TABLE IF EXISTS user_credentials DROP CONSTRAINT IF EXISTS check_github_app_id_and_external_service_type_user_credentials;\n\n-- delete the `github_app_id` column\nALTER TABLE IF EXISTS user_credentials DROP COLUMN IF EXISTS github_app_id;", |
| 11296 | + "Privileged": false, |
| 11297 | + "NonIdempotent": false, |
| 11298 | + "Parents": [ |
| 11299 | + 1719498032 |
| 11300 | + ], |
| 11301 | + "IsCreateIndexConcurrently": false, |
| 11302 | + "IndexMetadata": null |
| 11303 | + }, |
| 11304 | + { |
| 11305 | + "ID": 1719498128, |
| 11306 | + "Name": "add_kind_column_github_app", |
| 11307 | + "UpQuery": "DO $$\nBEGIN\n IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'github_app_kind') THEN\n CREATE TYPE github_app_kind AS ENUM (\n 'COMMIT_SIGNING',\n 'REPO_SYNC',\n 'USER_CREDENTIAL',\n 'SITE_CREDENTIAL'\n );\n END IF;\nEND\n$$;\n\nALTER TABLE IF EXISTS github_apps\n ADD COLUMN IF NOT EXISTS kind github_app_kind DEFAULT 'REPO_SYNC';\n\nUPDATE github_apps\nSET kind = 'COMMIT_SIGNING'\nWHERE domain = 'batches';\n\n-- This is expected to fail if any row is using an unknown value that is not repos or batches.\n-- We only allow repos or batches at this time.\nALTER TABLE IF EXISTS github_apps\nALTER COLUMN kind SET NOT NULL;", |
| 11308 | + "DownQuery": "ALTER TABLE IF EXISTS github_apps DROP COLUMN IF EXISTS kind;\n\nDROP TYPE IF EXISTS github_app_kind;", |
| 11309 | + "Privileged": false, |
| 11310 | + "NonIdempotent": false, |
| 11311 | + "Parents": [ |
| 11312 | + 1719498091 |
| 11313 | + ], |
| 11314 | + "IsCreateIndexConcurrently": false, |
| 11315 | + "IndexMetadata": null |
| 11316 | + }, |
| 11317 | + { |
| 11318 | + "ID": 1720165387, |
| 11319 | + "Name": "notebooks default to keyword search", |
| 11320 | + "UpQuery": "ALTER TABLE IF EXISTS notebooks ALTER COLUMN pattern_type SET DEFAULT 'keyword';", |
| 11321 | + "DownQuery": "ALTER TABLE IF EXISTS notebooks ALTER COLUMN pattern_type SET DEFAULT 'standard';", |
| 11322 | + "Privileged": false, |
| 11323 | + "NonIdempotent": false, |
| 11324 | + "Parents": [ |
| 11325 | + 1719214941, |
| 11326 | + 1719498128 |
| 11327 | + ], |
| 11328 | + "IsCreateIndexConcurrently": false, |
| 11329 | + "IndexMetadata": null |
11224 | 11330 | }
|
11225 | 11331 | ],
|
11226 | 11332 | "BoundsByRev": {
|
|
11484 | 11590 | 1713958707
|
11485 | 11591 | ],
|
11486 | 11592 | "PreCreation": false
|
| 11593 | + }, |
| 11594 | + "v5.5.0": { |
| 11595 | + "RootID": 1648051770, |
| 11596 | + "LeafIDs": [ |
| 11597 | + 1720165387 |
| 11598 | + ], |
| 11599 | + "PreCreation": false |
11487 | 11600 | }
|
11488 | 11601 | }
|
11489 | 11602 | }
|
|
0 commit comments