From acf0a35bc2d5de276cb6014b48ad89234c8224f1 Mon Sep 17 00:00:00 2001 From: Rakshitha-D Date: Tue, 31 Dec 2024 10:10:02 +0530 Subject: [PATCH 1/3] #OBS-I320: added is_owner column to the oauth_users table --- .../configs/migrations/03-obsrv/V4__update_dataset_ddl.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql index 8808a787..73a51969 100644 --- a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql +++ b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql @@ -102,3 +102,6 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obsrv; ALTER TABLE oauth_users ADD COLUMN roles TEXT[] DEFAULT ARRAY['viewer']; ALTER TABLE oauth_users ADD COLUMN status VARCHAR(255) DEFAULT 'active'; ALTER TABLE oauth_users ADD CONSTRAINT oauth_users_user_name_key UNIQUE (user_name); + +ALTER TABLE oauth_users ADD COLUMN is_owner BOOLEAN DEFAULT FALSE; +UPDATE oauth_users SET is_owner=true WHERE user_name ='obsrv_admin'; \ No newline at end of file From 9806455cc93a015b37c99779dc173dd4a8aede88 Mon Sep 17 00:00:00 2001 From: Rakshitha-D Date: Tue, 31 Dec 2024 10:15:01 +0530 Subject: [PATCH 2/3] #OBS-I320: updated commands to v5 --- .../configs/migrations/03-obsrv/V4__update_dataset_ddl.sql | 5 +---- .../migrations/03-obsrv/V5__dataset_management_ddl.sql | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql index 73a51969..94beefe0 100644 --- a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql +++ b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql @@ -101,7 +101,4 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obsrv; ALTER TABLE oauth_users ADD COLUMN roles TEXT[] DEFAULT ARRAY['viewer']; ALTER TABLE oauth_users ADD COLUMN status VARCHAR(255) DEFAULT 'active'; -ALTER TABLE oauth_users ADD CONSTRAINT oauth_users_user_name_key UNIQUE (user_name); - -ALTER TABLE oauth_users ADD COLUMN is_owner BOOLEAN DEFAULT FALSE; -UPDATE oauth_users SET is_owner=true WHERE user_name ='obsrv_admin'; \ No newline at end of file +ALTER TABLE oauth_users ADD CONSTRAINT oauth_users_user_name_key UNIQUE (user_name); \ No newline at end of file diff --git a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V5__dataset_management_ddl.sql b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V5__dataset_management_ddl.sql index 10db9310..f219923b 100644 --- a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V5__dataset_management_ddl.sql +++ b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V5__dataset_management_ddl.sql @@ -8,4 +8,7 @@ UPDATE datasources SET is_primary = true, name = datasource; ALTER TABLE connector_instances ADD COLUMN IF NOT EXISTS name TEXT; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO obsrv; -GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obsrv; \ No newline at end of file +GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obsrv; + +ALTER TABLE oauth_users ADD COLUMN is_owner BOOLEAN DEFAULT FALSE; +UPDATE oauth_users SET is_owner=true WHERE user_name ='obsrv_admin'; \ No newline at end of file From 2e3980b5f20dd7822cfc75e22d3a414696cdbc0b Mon Sep 17 00:00:00 2001 From: Rakshitha-D Date: Tue, 31 Dec 2024 10:16:57 +0530 Subject: [PATCH 3/3] #OBS-I320: updated commands to v5 --- .../configs/migrations/03-obsrv/V4__update_dataset_ddl.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql index 94beefe0..8808a787 100644 --- a/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql +++ b/helmcharts/services/postgresql-migration/configs/migrations/03-obsrv/V4__update_dataset_ddl.sql @@ -101,4 +101,4 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obsrv; ALTER TABLE oauth_users ADD COLUMN roles TEXT[] DEFAULT ARRAY['viewer']; ALTER TABLE oauth_users ADD COLUMN status VARCHAR(255) DEFAULT 'active'; -ALTER TABLE oauth_users ADD CONSTRAINT oauth_users_user_name_key UNIQUE (user_name); \ No newline at end of file +ALTER TABLE oauth_users ADD CONSTRAINT oauth_users_user_name_key UNIQUE (user_name);