perforce: remove legacy path_includes and path_excludes columns. (#55195)

This commit is contained in:
Alex Ostrikov 2023-07-21 18:56:51 +04:00 committed by GitHub
parent 03386e56c2
commit 58c2fb07b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 37 deletions

View File

@ -25012,32 +25012,6 @@
"Name": "sub_repo_permissions",
"Comment": "Responsible for storing permissions at a finer granularity than repo",
"Columns": [
{
"Name": "path_excludes",
"Index": 5,
"TypeName": "text[]",
"IsNullable": true,
"Default": "",
"CharacterMaximumLength": 0,
"IsIdentity": false,
"IdentityGeneration": "",
"IsGenerated": "NEVER",
"GenerationExpression": "",
"Comment": ""
},
{
"Name": "path_includes",
"Index": 4,
"TypeName": "text[]",
"IsNullable": true,
"Default": "",
"CharacterMaximumLength": 0,
"IsIdentity": false,
"IdentityGeneration": "",
"IsGenerated": "NEVER",
"GenerationExpression": "",
"Comment": ""
},
{
"Name": "paths",
"Index": 7,

View File

@ -3862,15 +3862,13 @@ Foreign-key constraints:
# Table "public.sub_repo_permissions"
```
Column | Type | Collation | Nullable | Default
---------------+--------------------------+-----------+----------+---------
repo_id | integer | | not null |
user_id | integer | | not null |
version | integer | | not null | 1
path_includes | text[] | | |
path_excludes | text[] | | |
updated_at | timestamp with time zone | | not null | now()
paths | text[] | | |
Column | Type | Collation | Nullable | Default
------------+--------------------------+-----------+----------+---------
repo_id | integer | | not null |
user_id | integer | | not null |
version | integer | | not null | 1
updated_at | timestamp with time zone | | not null | now()
paths | text[] | | |
Indexes:
"sub_repo_permissions_repo_id_user_id_version_uindex" UNIQUE, btree (repo_id, user_id, version)
"sub_repo_perms_user_id" btree (user_id)

View File

@ -1099,6 +1099,9 @@ go_library(
"frontend/1689692530_add_column_pool_repo_id_to_gitserver_repos/down.sql",
"frontend/1689692530_add_column_pool_repo_id_to_gitserver_repos/metadata.yaml",
"frontend/1689692530_add_column_pool_repo_id_to_gitserver_repos/up.sql",
"frontend/1689942733_drop_path_includes_path_excludes_columns_from_sub_repo_permissions/down.sql",
"frontend/1689942733_drop_path_includes_path_excludes_columns_from_sub_repo_permissions/metadata.yaml",
"frontend/1689942733_drop_path_includes_path_excludes_columns_from_sub_repo_permissions/up.sql",
],
importpath = "github.com/sourcegraph/sourcegraph/migrations",
visibility = ["//visibility:public"],

View File

@ -0,0 +1,3 @@
ALTER TABLE ONLY sub_repo_permissions
ADD COLUMN IF NOT EXISTS path_includes text[],
ADD COLUMN IF NOT EXISTS path_excludes text[];

View File

@ -0,0 +1,2 @@
name: drop path_includes, path_excludes columns from sub_repo_permissions
parents: [1689692530]

View File

@ -0,0 +1,3 @@
ALTER TABLE ONLY sub_repo_permissions
DROP COLUMN IF EXISTS path_includes,
DROP COLUMN IF EXISTS path_excludes;

View File

@ -4499,8 +4499,6 @@ CREATE TABLE sub_repo_permissions (
repo_id integer NOT NULL,
user_id integer NOT NULL,
version integer DEFAULT 1 NOT NULL,
path_includes text[],
path_excludes text[],
updated_at timestamp with time zone DEFAULT now() NOT NULL,
paths text[]
);