notebooks: set default pattern type to keyword (#63662)

Relates to https://github.com/sourcegraph/sourcegraph/pull/63472

This changes the default patternType of Notebooks from "standard" to
"keyword". As a consequence, all new notebooks will default to keyword
search. Existing notebooks will keep using standard search.

Test plan:
- I ran the migration locally and verified that new notebooks use
"keyword" as default.
This commit is contained in:
Stefan Hengl 2024-07-09 09:36:20 +02:00 committed by GitHub
parent 12b0e4e233
commit e3d112b01c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 22 additions and 5 deletions

View File

@ -11299,6 +11299,20 @@
],
"IsCreateIndexConcurrently": false,
"IndexMetadata": null
},
{
"ID": 1720165387,
"Name": "notebooks default to keyword search",
"UpQuery": "ALTER TABLE IF EXISTS notebooks ALTER COLUMN pattern_type SET DEFAULT 'keyword';",
"DownQuery": "ALTER TABLE IF EXISTS notebooks ALTER COLUMN pattern_type SET DEFAULT 'standard';",
"Privileged": false,
"NonIdempotent": false,
"Parents": [
1719214941,
1719498128
],
"IsCreateIndexConcurrently": false,
"IndexMetadata": null
}
],
"BoundsByRev": {
@ -11559,8 +11573,7 @@
"v5.4.0": {
"RootID": 1648051770,
"LeafIDs": [
1719214941,
1719498128
1720165387
],
"PreCreation": false
}

View File

@ -19142,7 +19142,7 @@
"Index": 12,
"TypeName": "pattern_type",
"IsNullable": false,
"Default": "'standard'::pattern_type",
"Default": "'keyword'::pattern_type",
"CharacterMaximumLength": 0,
"IsIdentity": false,
"IdentityGeneration": "",

View File

@ -2806,7 +2806,7 @@ Foreign-key constraints:
namespace_user_id | integer | | |
namespace_org_id | integer | | |
updater_user_id | integer | | |
pattern_type | pattern_type | | not null | 'standard'::pattern_type
pattern_type | pattern_type | | not null | 'keyword'::pattern_type
Indexes:
"notebooks_pkey" PRIMARY KEY, btree (id)
"notebooks_blocks_tsvector_idx" gin (blocks_tsvector)

View File

@ -0,0 +1 @@
ALTER TABLE IF EXISTS notebooks ALTER COLUMN pattern_type SET DEFAULT 'standard';

View File

@ -0,0 +1,2 @@
name: notebooks default to keyword search
parents: [1719214941, 1719498128]

View File

@ -0,0 +1 @@
ALTER TABLE IF EXISTS notebooks ALTER COLUMN pattern_type SET DEFAULT 'keyword';

View File

@ -3571,7 +3571,7 @@ CREATE TABLE notebooks (
namespace_user_id integer,
namespace_org_id integer,
updater_user_id integer,
pattern_type pattern_type DEFAULT 'standard'::pattern_type NOT NULL,
pattern_type pattern_type DEFAULT 'keyword'::pattern_type NOT NULL,
CONSTRAINT blocks_is_array CHECK ((jsonb_typeof(blocks) = 'array'::text)),
CONSTRAINT notebooks_has_max_1_namespace CHECK ((((namespace_user_id IS NULL) AND (namespace_org_id IS NULL)) OR ((namespace_user_id IS NULL) <> (namespace_org_id IS NULL))))
);