Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: deprecate id column for some tables (#19582)
ecmadaoc0db15ec661b
diff --git a/backend/demo/data/dump.sql b/backend/demo/data/dump.sqlindex 598ae08428..e4e7a17416 100644--- a/backend/demo/data/dump.sql+++ b/backend/demo/data/dump.sql@@ -2,9 +2,8 @@-- PostgreSQL database dump------ Dumped from database version 16.11--- Dumped by pg_dump version 16.11+-- Dumped from database version 16.8+-- Dumped by pg_dump version 16.8SET statement_timeout = 0;SET lock_timeout = 0;@@ -107,7 +106,6 @@ ALTER SEQUENCE public.changelog_id_seq OWNED BY public.changelog.id;--CREATE TABLE public.db (- id integer NOT NULL,deleted boolean DEFAULT false NOT NULL,project text NOT NULL,instance text NOT NULL,@@ -122,7 +120,6 @@ CREATE TABLE public.db (--CREATE TABLE public.db_group (- id bigint NOT NULL,project text NOT NULL,resource_id text NOT NULL,name text DEFAULT ''::text NOT NULL,@@ -131,51 +128,11 @@ CREATE TABLE public.db_group ();------ Name: db_group_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.db_group_id_seq- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: db_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.db_group_id_seq OWNED BY public.db_group.id;-------- Name: db_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.db_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: db_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.db_id_seq OWNED BY public.db.id;------ Name: db_schema; Type: TABLE; Schema: public; Owner: ---CREATE TABLE public.db_schema (- id integer NOT NULL,instance text NOT NULL,db_name text NOT NULL,metadata json DEFAULT '{}'::json NOT NULL,@@ -184,26 +141,6 @@ CREATE TABLE public.db_schema ();------ Name: db_schema_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.db_schema_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: db_schema_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.db_schema_id_seq OWNED BY public.db_schema.id;------ Name: export_archive; Type: TABLE; Schema: public; Owner: ---@@ -241,7 +178,6 @@ ALTER SEQUENCE public.export_archive_id_seq OWNED BY public.export_archive.id;--CREATE TABLE public.idp (- id integer NOT NULL,resource_id text NOT NULL,name text NOT NULL,domain text NOT NULL,@@ -251,32 +187,11 @@ CREATE TABLE public.idp ();------ Name: idp_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.idp_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: idp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.idp_id_seq OWNED BY public.idp.id;------ Name: instance; Type: TABLE; Schema: public; Owner: ---CREATE TABLE public.instance (- id integer NOT NULL,deleted boolean DEFAULT false NOT NULL,environment text,resource_id text NOT NULL,@@ -313,26 +228,6 @@ CREATE SEQUENCE public.instance_change_history_id_seqALTER SEQUENCE public.instance_change_history_id_seq OWNED BY public.instance_change_history.id;------ Name: instance_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.instance_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: instance_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.instance_id_seq OWNED BY public.instance.id;------ Name: issue; Type: TABLE; Schema: public; Owner: ---@@ -531,7 +426,6 @@ CREATE TABLE public.plan_webhook_delivery (--CREATE TABLE public.policy (- id integer NOT NULL,enforce boolean DEFAULT true NOT NULL,updated_at timestamp with time zone DEFAULT now() NOT NULL,resource_type text NOT NULL,@@ -542,26 +436,6 @@ CREATE TABLE public.policy ();------ Name: policy_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.policy_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: policy_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.policy_id_seq OWNED BY public.policy.id;------ Name: principal; Type: TABLE; Schema: public; Owner: ---@@ -604,7 +478,6 @@ ALTER SEQUENCE public.principal_id_seq OWNED BY public.principal.id;--CREATE TABLE public.project (- id integer NOT NULL,deleted boolean DEFAULT false NOT NULL,name text NOT NULL,resource_id text NOT NULL,@@ -612,26 +485,6 @@ CREATE TABLE public.project ();------ Name: project_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.project_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: project_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.project_id_seq OWNED BY public.project.id;------ Name: project_webhook; Type: TABLE; Schema: public; Owner: ---@@ -703,7 +556,6 @@ ALTER SEQUENCE public.query_history_id_seq OWNED BY public.query_history.id;--CREATE TABLE public.release (- id bigint NOT NULL,deleted boolean DEFAULT false NOT NULL,project text NOT NULL,created_at timestamp with time zone DEFAULT now() NOT NULL,@@ -716,25 +568,6 @@ CREATE TABLE public.release ();------ Name: release_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.release_id_seq- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: release_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.release_id_seq OWNED BY public.release.id;------ Name: replica_heartbeat; Type: TABLE; Schema: public; Owner: ---@@ -797,7 +630,6 @@ ALTER SEQUENCE public.revision_id_seq OWNED BY public.revision.id;--CREATE TABLE public.role (- id bigint NOT NULL,resource_id text NOT NULL,name text NOT NULL,description text NOT NULL,@@ -806,25 +638,6 @@ CREATE TABLE public.role ();------ Name: role_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.role_id_seq- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: role_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.role_id_seq OWNED BY public.role.id;------ Name: service_account; Type: TABLE; Schema: public; Owner: ---@@ -844,32 +657,11 @@ CREATE TABLE public.service_account (--CREATE TABLE public.setting (- id integer NOT NULL,name text NOT NULL,value jsonb NOT NULL);------ Name: setting_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.setting_id_seq- AS integer- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: setting_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.setting_id_seq OWNED BY public.setting.id;------ Name: sheet_blob; Type: TABLE; Schema: public; Owner: ---@@ -994,32 +786,12 @@ ALTER SEQUENCE public.task_run_id_seq OWNED BY public.task_run.id;--CREATE TABLE public.task_run_log (- id bigint NOT NULL,task_run_id integer NOT NULL,created_at timestamp with time zone DEFAULT now() NOT NULL,payload jsonb DEFAULT '{}'::jsonb NOT NULL);------ Name: task_run_log_id_seq; Type: SEQUENCE; Schema: public; Owner: ------CREATE SEQUENCE public.task_run_log_id_seq- START WITH 1- INCREMENT BY 1- NO MINVALUE- NO MAXVALUE- CACHE 1;-------- Name: task_run_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ------ALTER SEQUENCE public.task_run_log_id_seq OWNED BY public.task_run_log.id;------ Name: user_group; Type: TABLE; Schema: public; Owner: ---@@ -1143,27 +915,6 @@ ALTER TABLE ONLY public.audit_log ALTER COLUMN id SET DEFAULT nextval('public.auALTER TABLE ONLY public.changelog ALTER COLUMN id SET DEFAULT nextval('public.changelog_id_seq'::regclass);------ Name: db id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.db ALTER COLUMN id SET DEFAULT nextval('public.db_id_seq'::regclass);-------- Name: db_group id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.db_group ALTER COLUMN id SET DEFAULT nextval('public.db_group_id_seq'::regclass);-------- Name: db_schema id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.db_schema ALTER COLUMN id SET DEFAULT nextval('public.db_schema_id_seq'::regclass);------ Name: export_archive id; Type: DEFAULT; Schema: public; Owner: ---@@ -1171,20 +922,6 @@ ALTER TABLE ONLY public.db_schema ALTER COLUMN id SET DEFAULT nextval('public.dbALTER TABLE ONLY public.export_archive ALTER COLUMN id SET DEFAULT nextval('public.export_archive_id_seq'::regclass);------ Name: idp id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.idp ALTER COLUMN id SET DEFAULT nextval('public.idp_id_seq'::regclass);-------- Name: instance id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.instance ALTER COLUMN id SET DEFAULT nextval('public.instance_id_seq'::regclass);------ Name: instance_change_history id; Type: DEFAULT; Schema: public; Owner: ---@@ -1220,13 +957,6 @@ ALTER TABLE ONLY public.plan ALTER COLUMN id SET DEFAULT nextval('public.plan_idALTER TABLE ONLY public.plan_check_run ALTER COLUMN id SET DEFAULT nextval('public.plan_check_run_id_seq'::regclass);------ Name: policy id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.policy ALTER COLUMN id SET DEFAULT nextval('public.policy_id_seq'::regclass);------ Name: principal id; Type: DEFAULT; Schema: public; Owner: ---@@ -1234,13 +964,6 @@ ALTER TABLE ONLY public.policy ALTER COLUMN id SET DEFAULT nextval('public.policALTER TABLE ONLY public.principal ALTER COLUMN id SET DEFAULT nextval('public.principal_id_seq'::regclass);------ Name: project id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.project ALTER COLUMN id SET DEFAULT nextval('public.project_id_seq'::regclass);------ Name: project_webhook id; Type: DEFAULT; Schema: public; Owner: ---@@ -1255,13 +978,6 @@ ALTER TABLE ONLY public.project_webhook ALTER COLUMN id SET DEFAULT nextval('pubALTER TABLE ONLY public.query_history ALTER COLUMN id SET DEFAULT nextval('public.query_history_id_seq'::regclass);------ Name: release id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.release ALTER COLUMN id SET DEFAULT nextval('public.release_id_seq'::regclass);------ Name: revision id; Type: DEFAULT; Schema: public; Owner: ---@@ -1269,20 +985,6 @@ ALTER TABLE ONLY public.release ALTER COLUMN id SET DEFAULT nextval('public.releALTER TABLE ONLY public.revision ALTER COLUMN id SET DEFAULT nextval('public.revision_id_seq'::regclass);------ Name: role id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.role ALTER COLUMN id SET DEFAULT nextval('public.role_id_seq'::regclass);-------- Name: setting id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.setting ALTER COLUMN id SET DEFAULT nextval('public.setting_id_seq'::regclass);------ Name: sync_history id; Type: DEFAULT; Schema: public; Owner: ---@@ -1304,13 +1006,6 @@ ALTER TABLE ONLY public.task ALTER COLUMN id SET DEFAULT nextval('public.task_idALTER TABLE ONLY public.task_run ALTER COLUMN id SET DEFAULT nextval('public.task_run_id_seq'::regclass);------ Name: task_run_log id; Type: DEFAULT; Schema: public; Owner: ------ALTER TABLE ONLY public.task_run_log ALTER COLUMN id SET DEFAULT nextval('public.task_run_log_id_seq'::regclass);------ Name: worksheet id; Type: DEFAULT; Schema: public; Owner: ---@@ -1343,11 +1038,11 @@ INSERT INTO public.audit_log (id, created_at, payload) VALUES (103, '2025-05-26INSERT INTO public.audit_log (id, created_at, payload) VALUES (113, '2025-05-26 07:27:50.339901+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.OrgPolicyService/UpdatePolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"policy\":{\"name\":\"environments/test/policies/tag\", \"type\":\"TAG\", \"tagPolicy\":{\"tags\":{\"bb.tag.review_config\":\"reviewConfigs/sql-review-sample-policy\"}}}, \"updateMask\":\"payload\", \"allowMissing\":true}", "response": "{\"name\":\"environments/test/policies/tag\", \"type\":\"TAG\", \"tagPolicy\":{\"tags\":{\"bb.tag.review_config\":\"reviewConfigs/sql-review-sample-policy\"}}, \"enforce\":true, \"resourceType\":\"ENVIRONMENT\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:59172", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (104, '2025-05-26 06:51:21.254849+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.profile\", \"value\":{\"workspaceProfileSettingValue\":{\"externalUrl\":\"https://demo.bytebase.com\", \"databaseChangeMode\":\"PIPELINE\"}}}, \"allowMissing\":true, \"updateMask\":\"value.workspaceProfileSettingValue.externalUrl\"}", "resource": "settings/bb.workspace.profile", "response": "{\"name\":\"settings/bb.workspace.profile\", \"value\":{\"workspaceProfileSettingValue\":{\"externalUrl\":\"https://demo.bytebase.com\", \"databaseChangeMode\":\"PIPELINE\"}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.profile", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceProfileSettingValue": {"databaseChangeMode": "PIPELINE"}}}, "requestMetadata": {"callerIp": "[::1]:56515", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (105, '2025-05-26 07:15:33.833558+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.UserService/CreateUser", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"user\":{\"name\":\"users/0\", \"email\":\"[email protected]\", \"title\":\"Dev1\", \"userType\":\"USER\"}}", "resource": "users/0", "response": "{\"name\":\"users/102\", \"email\":\"[email protected]\", \"title\":\"Dev1\", \"userType\":\"USER\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58583", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (106, '2025-05-26 07:15:33.845475+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748242086302\"}, \"etag\":\"1748242086302\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243733843\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58583", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (106, '2025-05-26 07:15:33.845475+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748242086302\"}, \"etag\":\"1748242086302\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243733843\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58583", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (107, '2025-05-26 07:16:05.086374+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.UserService/CreateUser", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"user\":{\"name\":\"users/0\", \"email\":\"[email protected]\", \"title\":\"dba1\", \"userType\":\"USER\"}}", "resource": "users/0", "response": "{\"name\":\"users/103\", \"email\":\"[email protected]\", \"title\":\"dba1\", \"userType\":\"USER\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58583", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (108, '2025-05-26 07:16:05.093675+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"]}], \"etag\":\"1748243733843\"}, \"etag\":\"1748243733843\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243765092\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58583", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (108, '2025-05-26 07:16:05.093675+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"]}], \"etag\":\"1748243733843\"}, \"etag\":\"1748243733843\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243765092\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58583", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (109, '2025-05-26 07:16:33.694524+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.UserService/CreateUser", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"user\":{\"name\":\"users/0\", \"email\":\"[email protected]\", \"title\":\"API user\", \"userType\":\"SERVICE_ACCOUNT\"}}", "resource": "users/0", "response": "{\"name\":\"users/104\", \"email\":\"[email protected]\", \"title\":\"API user\", \"userType\":\"SERVICE_ACCOUNT\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58813", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (110, '2025-05-26 07:16:33.700462+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243765092\"}, \"etag\":\"1748243765092\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243793699\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58813", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (110, '2025-05-26 07:16:33.700462+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243765092\"}, \"etag\":\"1748243765092\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243793699\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58813", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (111, '2025-05-26 07:24:34.037938+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.RoleService/UpdateRole", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"role\":{\"name\":\"roles/qa-custom-role\", \"title\":\"QA\", \"description\":\"Custom-defined QA role\", \"permissions\":[\"bb.databases.get\", \"bb.databases.getSchema\", \"bb.databases.list\", \"bb.issueComments.create\", \"bb.issues.get\", \"bb.issues.list\", \"bb.planCheckRuns.list\", \"bb.planCheckRuns.run\", \"bb.plans.get\", \"bb.plans.list\", \"bb.projects.get\", \"bb.projects.getIamPolicy\", \"bb.rollouts.get\", \"bb.taskRuns.list\"]}, \"updateMask\":\"title,description,permissions\", \"allowMissing\":true}", "response": "{\"name\":\"roles/qa-custom-role\", \"title\":\"QA\", \"description\":\"Custom-defined QA role\", \"permissions\":[\"bb.databases.get\", \"bb.databases.getSchema\", \"bb.databases.list\", \"bb.issueComments.create\", \"bb.issues.get\", \"bb.issues.list\", \"bb.planCheckRuns.list\", \"bb.planCheckRuns.run\", \"bb.plans.get\", \"bb.plans.list\", \"bb.projects.get\", \"bb.projects.getIamPolicy\", \"bb.rollouts.get\", \"bb.taskRuns.list\"], \"type\":\"CUSTOM\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:59178", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (114, '2025-05-26 07:38:07.205352+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.RiskService/CreateRisk", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"risk\":{\"source\":\"DDL\", \"title\":\" ALTER column in production environment is high risk\", \"level\":300, \"active\":true, \"condition\":{\"expression\":\"environment_id == \\\"prod\\\" && sql_type == \\\"ALTER_TABLE\\\"\"}}}", "response": "{\"name\":\"risks/101\", \"source\":\"DDL\", \"title\":\" ALTER column in production environment is high risk\", \"level\":300, \"active\":true, \"condition\":{\"expression\":\"environment_id == \\\"prod\\\" && sql_type == \\\"ALTER_TABLE\\\"\"}}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:59172", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (115, '2025-05-26 07:38:48.901692+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.RiskService/CreateRisk", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"risk\":{\"source\":\"DDL\", \"title\":\"CREATE TABLE in production environment is moderate risk\", \"level\":300, \"active\":true, \"condition\":{\"expression\":\"environment_id == \\\"prod\\\" && sql_type == \\\"CREATE_TABLE\\\"\"}}}", "response": "{\"name\":\"risks/102\", \"source\":\"DDL\", \"title\":\"CREATE TABLE in production environment is moderate risk\", \"level\":300, \"active\":true, \"condition\":{\"expression\":\"environment_id == \\\"prod\\\" && sql_type == \\\"CREATE_TABLE\\\"\"}}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:59172", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;@@ -1357,13 +1052,13 @@ INSERT INTO public.audit_log (id, created_at, payload) VALUES (118, '2025-05-26INSERT INTO public.audit_log (id, created_at, payload) VALUES (119, '2025-05-26 07:40:43.115949+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.approval", "response": "{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.approval", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceApprovalSettingValue": {"rules": [{"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "source == \"DML\" && level == 300"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "source == \"DML\" && level == 0"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs DBA approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs Administrator approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA -> Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."}, "condition": {}}]}}}, "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (132, '2025-05-26 07:56:06.908019+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.InstanceService/CreateInstance", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "status": {"code": 3, "message": "invalid datasource ADMIN, error failed to connect to `user=bb database=postgres`: /tmp/.s.PGSQL.5432 (/tmp): dial error: dial unix /tmp/.s.PGSQL.5432: connect: no such file or directory"}, "request": "{\"instance\":{\"name\":\"instances/bytebase-meta\", \"state\":\"ACTIVE\", \"title\":\"bytebase-meta\", \"engine\":\"POSTGRES\", \"dataSources\":[{\"id\":\"35a64b4a-543f-4eac-ad32-b191a958c66d\", \"type\":\"ADMIN\", \"username\":\"bb\", \"host\":\"/tmp\", \"port\":\"5432\", \"authenticationType\":\"PASSWORD\"}], \"environment\":\"environments/prod\", \"activation\":true}, \"instanceId\":\"bytebase-meta\", \"validateOnly\":true}", "resource": "instances/bytebase-meta", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61847", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (120, '2025-05-26 07:40:47.856611+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.approval", "response": "{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.approval", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceApprovalSettingValue": {"rules": [{"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "source == \"DML\" && level == 300 || source == \"DDL\" && level == 300"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "source == \"DML\" && level == 0"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs DBA approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs Administrator approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA -> Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."}, "condition": {}}]}}}, "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (127, '2025-05-26 07:48:20.879598+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.OrgPolicyService/UpdatePolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"policy\":{\"name\":\"policies/masking_rule\", \"type\":\"MASKING_RULE\", \"maskingRulePolicy\":{\"rules\":[{\"id\":\"e0743172-c9c7-43f8-9923-9a3c06012cee\", \"condition\":{\"expression\":\"classification_level in [\\\"4\\\"]\"}, \"semanticType\":\"bb.default\"}]}, \"resourceType\":\"WORKSPACE\"}, \"updateMask\":\"payload\", \"allowMissing\":true}", "response": "{\"name\":\"policies/masking_rule\", \"type\":\"MASKING_RULE\", \"maskingRulePolicy\":{\"rules\":[{\"id\":\"e0743172-c9c7-43f8-9923-9a3c06012cee\", \"condition\":{\"expression\":\"classification_level in [\\\"4\\\"]\"}, \"semanticType\":\"bb.default\"}]}, \"enforce\":true, \"resourceType\":\"WORKSPACE\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61234", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (121, '2025-05-26 07:40:51.55467+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200 || source == \\\"DDL\\\" &&\\nlevel == 0\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.approval", "response": "{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200 || source == \\\"DDL\\\" &&\\nlevel == 0\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.approval", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceApprovalSettingValue": {"rules": [{"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "source == \"DML\" && level == 300 || source == \"DDL\" && level == 300"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "source == \"DML\" && level == 0 || source == \"DDL\" && level == 200"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs DBA approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs Administrator approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA -> Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."}, "condition": {}}]}}}, "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (122, '2025-05-26 07:40:53.534087+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200 || source == \\\"DDL\\\" &&\\nlevel == 0 || source == \\\"DML\\\" && level == 200\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.approval", "response": "{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200 || source == \\\"DDL\\\" &&\\nlevel == 0 || source == \\\"DML\\\" && level == 200\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.approval", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceApprovalSettingValue": {"rules": [{"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "source == \"DML\" && level == 300 || source == \"DDL\" && level == 300"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "source == \"DML\" && level == 0 || source == \"DDL\" && level == 200 || source == \"DDL\" &&\nlevel == 0"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs DBA approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs Administrator approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA -> Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."}, "condition": {}}]}}}, "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (123, '2025-05-26 07:41:12.810007+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243793699\"}, \"etag\":\"1748243793699\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748245272807\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (123, '2025-05-26 07:41:12.810007+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748243793699\"}, \"etag\":\"1748243793699\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748245272807\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (124, '2025-05-26 07:44:16.159285+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.data-classification\", \"value\":{\"dataClassificationSettingValue\":{\"configs\":[{\"id\":\"e5680e79-e84b-486e-8cb2-76c984c3fac9\", \"title\":\"Classification Example\", \"levels\":[{\"id\":\"1\", \"title\":\"Level 1\"}, {\"id\":\"2\", \"title\":\"Level 2\"}, {\"id\":\"3\", \"title\":\"Level 3\"}, {\"id\":\"4\", \"title\":\"Level 4\"}], \"classification\":{\"1\":{\"id\":\"1\", \"title\":\"Basic\"}, \"1-1\":{\"id\":\"1-1\", \"title\":\"Basic\", \"levelId\":\"1\"}, \"1-2\":{\"id\":\"1-2\", \"title\":\"Contact\", \"levelId\":\"2\"}, \"1-3\":{\"id\":\"1-3\", \"title\":\"Health\", \"levelId\":\"4\"}, \"2\":{\"id\":\"2\", \"title\":\"Relationship\"}, \"2-1\":{\"id\":\"2-1\", \"title\":\"Social\", \"levelId\":\"1\"}, \"2-2\":{\"id\":\"2-2\", \"title\":\"Business\", \"levelId\":\"3\"}}}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.data-classification", "response": "{\"name\":\"settings/bb.workspace.data-classification\", \"value\":{\"dataClassificationSettingValue\":{\"configs\":[{\"id\":\"e5680e79-e84b-486e-8cb2-76c984c3fac9\", \"title\":\"Classification Example\", \"levels\":[{\"id\":\"1\", \"title\":\"Level 1\"}, {\"id\":\"2\", \"title\":\"Level 2\"}, {\"id\":\"3\", \"title\":\"Level 3\"}, {\"id\":\"4\", \"title\":\"Level 4\"}], \"classification\":{\"1\":{\"id\":\"1\", \"title\":\"Basic\"}, \"1-1\":{\"id\":\"1-1\", \"title\":\"Basic\", \"levelId\":\"1\"}, \"1-2\":{\"id\":\"1-2\", \"title\":\"Contact\", \"levelId\":\"2\"}, \"1-3\":{\"id\":\"1-3\", \"title\":\"Health\", \"levelId\":\"4\"}, \"2\":{\"id\":\"2\", \"title\":\"Relationship\"}, \"2-1\":{\"id\":\"2-1\", \"title\":\"Social\", \"levelId\":\"1\"}, \"2-2\":{\"id\":\"2-2\", \"title\":\"Business\", \"levelId\":\"3\"}}}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.data-classification", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"dataClassificationSettingValue": {}}}, "requestMetadata": {"callerIp": "[::1]:60530", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (125, '2025-05-26 07:47:11.561832+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.semantic-types\", \"value\":{\"semanticTypeSettingValue\":{\"types\":[{\"id\":\"bb.default\", \"title\":\"Default\", \"description\":\"Default type with full masking\"}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.semantic-types", "response": "{\"name\":\"settings/bb.workspace.semantic-types\", \"value\":{\"semanticTypeSettingValue\":{\"types\":[{\"id\":\"bb.default\", \"title\":\"Default\", \"description\":\"Default type with full masking\"}]}}}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61234", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (126, '2025-05-26 07:47:13.546539+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.semantic-types\", \"value\":{\"semanticTypeSettingValue\":{\"types\":[{\"id\":\"bb.default\", \"title\":\"Default\", \"description\":\"Default type with full masking\"}, {\"id\":\"bb.default-partial\", \"title\":\"Default Partial\", \"description\":\"Default partial type with partial masking\"}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.semantic-types", "response": "{\"name\":\"settings/bb.workspace.semantic-types\", \"value\":{\"semanticTypeSettingValue\":{\"types\":[{\"id\":\"bb.default\", \"title\":\"Default\", \"description\":\"Default type with full masking\"}, {\"id\":\"bb.default-partial\", \"title\":\"Default Partial\", \"description\":\"Default partial type with partial masking\"}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.semantic-types", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"semanticTypeSettingValue": {"types": [{"id": "bb.default", "title": "Default", "description": "Default type with full masking"}]}}}, "requestMetadata": {"callerIp": "[::1]:61234", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (127, '2025-05-26 07:48:20.879598+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.OrgPolicyService/UpdatePolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"policy\":{\"name\":\"policies/masking_rule\", \"type\":\"MASKING_RULE\", \"maskingRulePolicy\":{\"rules\":[{\"id\":\"e0743172-c9c7-43f8-9923-9a3c06012cee\", \"condition\":{\"expression\":\"classification_level in [\\\"4\\\"]\"}, \"semanticType\":\"bb.default\"}]}, \"resourceType\":\"WORKSPACE\"}, \"updateMask\":\"payload\", \"allowMissing\":true}", "response": "{\"name\":\"policies/masking_rule\", \"type\":\"MASKING_RULE\", \"maskingRulePolicy\":{\"rules\":[{\"id\":\"e0743172-c9c7-43f8-9923-9a3c06012cee\", \"condition\":{\"expression\":\"classification_level in [\\\"4\\\"]\"}, \"semanticType\":\"bb.default\"}]}, \"enforce\":true, \"resourceType\":\"WORKSPACE\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61234", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (128, '2025-05-26 07:48:23.462873+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.OrgPolicyService/UpdatePolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"policy\":{\"name\":\"policies/masking_rule\", \"type\":\"MASKING_RULE\", \"maskingRulePolicy\":{\"rules\":[{\"id\":\"1f3018bb-f4ea-4daa-b4b3-6e32bce0d22e\", \"condition\":{\"expression\":\"classification_level in [\\\"2\\\", \\\"3\\\"]\"}, \"semanticType\":\"bb.default-partial\"}, {\"id\":\"e0743172-c9c7-43f8-9923-9a3c06012cee\", \"condition\":{\"expression\":\"classification_level in [\\\"4\\\"]\"}, \"semanticType\":\"bb.default\"}]}, \"resourceType\":\"WORKSPACE\"}, \"updateMask\":\"payload\", \"allowMissing\":true}", "response": "{\"name\":\"policies/masking_rule\", \"type\":\"MASKING_RULE\", \"maskingRulePolicy\":{\"rules\":[{\"id\":\"1f3018bb-f4ea-4daa-b4b3-6e32bce0d22e\", \"condition\":{\"expression\":\"classification_level in [\\\"2\\\", \\\"3\\\"]\"}, \"semanticType\":\"bb.default-partial\"}, {\"id\":\"e0743172-c9c7-43f8-9923-9a3c06012cee\", \"condition\":{\"expression\":\"classification_level in [\\\"4\\\"]\"}, \"semanticType\":\"bb.default\"}]}, \"enforce\":true, \"resourceType\":\"WORKSPACE\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61234", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (129, '2025-05-26 07:49:51.250743+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.watermark\", \"value\":{\"stringValue\":\"1\"}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.watermark", "response": "{\"name\":\"settings/bb.workspace.watermark\", \"value\":{\"stringValue\":\"1\"}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.watermark", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"stringValue": "0"}}, "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (130, '2025-05-26 07:50:36.063194+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.profile\", \"value\":{\"workspaceProfileSettingValue\":{\"externalUrl\":\"https://demo.bytebase.com\", \"domains\":[\"example.com\"], \"databaseChangeMode\":\"PIPELINE\"}}}, \"allowMissing\":true, \"updateMask\":\"value.workspaceProfileSettingValue.domains\"}", "resource": "settings/bb.workspace.profile", "response": "{\"name\":\"settings/bb.workspace.profile\", \"value\":{\"workspaceProfileSettingValue\":{\"externalUrl\":\"https://demo.bytebase.com\", \"domains\":[\"example.com\"], \"databaseChangeMode\":\"PIPELINE\"}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.profile", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceProfileSettingValue": {"externalUrl": "https://demo.bytebase.com", "databaseChangeMode": "PIPELINE"}}}, "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;@@ -1375,6 +1070,7 @@ INSERT INTO public.audit_log (id, created_at, payload) VALUES (136, '2025-05-26INSERT INTO public.audit_log (id, created_at, payload) VALUES (137, '2025-05-26 07:56:59.903652+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseService/BatchUpdateDatabases", "parent": "projects/metadb", "request": "{\"parent\":\"-\", \"requests\":[{\"database\":{\"name\":\"instances/bytebase-meta/databases/bb\", \"project\":\"projects/metadb\"}, \"updateMask\":\"project\"}]}", "resource": "-", "response": "{\"databases\":[{\"name\":\"instances/bytebase-meta/databases/bb\", \"state\":\"ACTIVE\", \"successfulSyncTime\":\"2025-05-26T07:56:53.177942Z\", \"project\":\"projects/metadb\", \"effectiveEnvironment\":\"environments/prod\", \"instanceResource\":{\"title\":\"bytebase-meta\", \"engine\":\"POSTGRES\", \"engineVersion\":\"16.0.0\", \"dataSources\":[{\"id\":\"35a64b4a-543f-4eac-ad32-b191a958c66d\", \"type\":\"ADMIN\", \"username\":\"bb\", \"host\":\"/tmp\", \"port\":\"8082\", \"authenticationType\":\"PASSWORD\", \"redisType\":\"STANDALONE\"}], \"activation\":true, \"name\":\"instances/bytebase-meta\", \"environment\":\"environments/prod\"}}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61847", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (138, '2025-05-26 07:57:47.352245+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SQLService/Query", "parent": "projects/metadb", "request": "{\"name\":\"instances/bytebase-meta/databases/bb\", \"statement\":\"-- Fully completed issues by project\\nSELECT\\n project.resource_id,\\n count(*)\\nFROM\\n issue\\n LEFT JOIN project ON issue.project_id = project.id\\nWHERE\\n NOT EXISTS (\\n SELECT\\n 1\\n FROM\\n task,\\n task_run\\n WHERE\\n task.pipeline_id = issue.pipeline_id\\n AND task.id = task_run.task_id\\n AND task_run.status != ''DONE''\\n )\\n AND issue.status = ''DONE''\\nGROUP BY\\n project.resource_id;\", \"limit\":1000, \"dataSourceId\":\"35a64b4a-543f-4eac-ad32-b191a958c66d\", \"queryOption\":{\"redisRunCommandsOn\":\"SINGLE_NODE\"}}", "resource": "instances/bytebase-meta/databases/bb", "response": "{\"results\":[{\"error\":\"ERROR: column issue.project_id does not exist (SQLSTATE 42703)\", \"latency\":\"0.000508209s\", \"statement\":\"-- Fully completed issues by project\\nSELECT\\n project.resource_id,\\n count(*)\\nFROM\\n issue\\n LEFT JOIN project ON issue.project_id = project.id\\nWHERE\\n NOT EXISTS (\\n SELECT\\n 1\\n FROM\\n task,\\n task_run\\n WHERE\\n task.pipeline_id = issue.pipeline_id\\n AND task.id = task_run.task_id\\n AND task_run.status != ''DONE''\\n )\\n AND issue.status = ''DONE''\\nGROUP BY\\n project.resource_id;\", \"postgresError\":{\"severity\":\"ERROR\", \"code\":\"42703\", \"message\":\"column issue.project_id does not exist\", \"hint\":\"Perhaps you meant to reference the column \\\"issue.project\\\".\", \"position\":115, \"file\":\"parse_relation.c\", \"line\":3729, \"routine\":\"errorMissingColumn\"}, \"allowExport\":true}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (139, '2025-05-26 07:58:13.180421+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SQLService/Query", "parent": "projects/metadb", "request": "{\"name\":\"instances/bytebase-meta/databases/bb\", \"statement\":\"-- Issues created by user\\nSELECT\\n issue.creator_id,\\n principal.email,\\n COUNT(issue.creator_id) AS amount\\nFROM\\n issue\\n INNER JOIN principal ON issue.creator_id = principal.id\\nGROUP BY\\n issue.creator_id,\\n principal.email\\nORDER BY\\n COUNT(issue.creator_id) DESC;\", \"limit\":1000, \"dataSourceId\":\"35a64b4a-543f-4eac-ad32-b191a958c66d\", \"queryOption\":{\"redisRunCommandsOn\":\"SINGLE_NODE\"}}", "resource": "instances/bytebase-meta/databases/bb", "response": "{\"results\":[{\"columnNames\":[\"creator_id\", \"email\", \"amount\"], \"columnTypeNames\":[\"INT4\", \"TEXT\", \"INT8\"], \"masked\":[false, false, false], \"sensitive\":[false, false, false], \"latency\":\"0.001358958s\", \"statement\":\"-- Issues created by user\\nSELECT\\n issue.creator_id,\\n principal.email,\\n COUNT(issue.creator_id) AS amount\\nFROM\\n issue\\n INNER JOIN principal ON issue.creator_id = principal.id\\nGROUP BY\\n issue.creator_id,\\n principal.email\\nORDER BY\\n COUNT(issue.creator_id) DESC;\", \"allowExport\":true}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (184, '2025-06-09 02:21:04.278663+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseService/UpdateDatabase", "parent": "projects/hr", "request": "{\"database\":{\"name\":\"instances/prod-sample-instance/databases/hr_prod\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.301195Z\",\"project\":\"projects/hr\",\"environment\":\"environments/prod\",\"effectiveEnvironment\":\"environments/prod\",\"instanceResource\":{\"title\":\"Prod Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"9af4f227-a55e-4e82-b7f5-c7193b5f405c\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"},{\"id\":\"e700ae12-173e-4f0d-8590-0414cf6a9405\",\"type\":\"READ_ONLY\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/prod-sample-instance\",\"environment\":\"environments/prod\"},\"backupAvailable\":true},\"updateMask\":\"drifted\"}", "resource": "instances/prod-sample-instance/databases/hr_prod", "response": "{\"name\":\"instances/prod-sample-instance/databases/hr_prod\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.301195Z\",\"project\":\"projects/hr\",\"effectiveEnvironment\":\"environments/prod\",\"instanceResource\":{\"title\":\"Prod Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"9af4f227-a55e-4e82-b7f5-c7193b5f405c\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"},{\"id\":\"e700ae12-173e-4f0d-8590-0414cf6a9405\",\"type\":\"READ_ONLY\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/prod-sample-instance\",\"environment\":\"environments/prod\"},\"backupAvailable\":true}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:56354", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (140, '2025-05-26 08:03:36.061032+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.InstanceService/CreateInstance", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"instance\":{\"name\":\"instances/test-sample-instance\", \"state\":\"ACTIVE\", \"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\"}], \"environment\":\"environments/test\", \"activation\":true}, \"instanceId\":\"test-sample-instance\", \"validateOnly\":true}", "resource": "instances/test-sample-instance", "response": "{\"name\":\"instances/test-sample-instance\", \"state\":\"ACTIVE\", \"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\", \"redisType\":\"STANDALONE\"}], \"environment\":\"environments/test\", \"activation\":true}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (141, '2025-05-26 08:03:43.346664+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.InstanceService/CreateInstance", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"instance\":{\"name\":\"instances/test-sample-instance\", \"state\":\"ACTIVE\", \"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\"}], \"environment\":\"environments/test\", \"activation\":true}, \"instanceId\":\"test-sample-instance\", \"validateOnly\":true}", "resource": "instances/test-sample-instance", "response": "{\"name\":\"instances/test-sample-instance\", \"state\":\"ACTIVE\", \"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\", \"redisType\":\"STANDALONE\"}], \"environment\":\"environments/test\", \"activation\":true}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (142, '2025-05-26 08:03:43.376894+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.InstanceService/CreateInstance", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"instance\":{\"name\":\"instances/test-sample-instance\", \"state\":\"ACTIVE\", \"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\"}], \"environment\":\"environments/test\", \"activation\":true}, \"instanceId\":\"test-sample-instance\"}", "resource": "instances/test-sample-instance", "response": "{\"name\":\"instances/test-sample-instance\", \"state\":\"ACTIVE\", \"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"engineVersion\":\"16.0.0\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\", \"redisType\":\"STANDALONE\"}], \"environment\":\"environments/test\", \"activation\":true, \"roles\":[{\"name\":\"instances/test-sample-instance/roles/bbsample\", \"roleName\":\"bbsample\", \"attribute\":\"Superuser Create role Create DB Replication Bypass RLS+\"}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;@@ -1390,11 +1086,11 @@ INSERT INTO public.audit_log (id, created_at, payload) VALUES (151, '2025-05-26INSERT INTO public.audit_log (id, created_at, payload) VALUES (152, '2025-05-26 08:05:25.065664+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseService/BatchUpdateDatabases", "parent": "projects/default", "request": "{\"parent\":\"-\", \"requests\":[{\"database\":{\"name\":\"instances/test-sample-instance/databases/hr_test\", \"project\":\"projects/hr\"}, \"updateMask\":\"project\"}]}", "resource": "-", "response": "{\"databases\":[{\"name\":\"instances/test-sample-instance/databases/hr_test\", \"state\":\"ACTIVE\", \"successfulSyncTime\":\"2025-05-26T08:03:53.183103Z\", \"project\":\"projects/hr\", \"effectiveEnvironment\":\"environments/test\", \"instanceResource\":{\"title\":\"Test Sample Instance\", \"engine\":\"POSTGRES\", \"engineVersion\":\"16.0.0\", \"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\", \"type\":\"ADMIN\", \"username\":\"bbsample\", \"host\":\"/tmp\", \"port\":\"8083\", \"authenticationType\":\"PASSWORD\", \"redisType\":\"STANDALONE\"}], \"activation\":true, \"name\":\"instances/test-sample-instance\", \"environment\":\"environments/test\"}, \"backupAvailable\":true}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:61457", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (153, '2025-05-26 08:07:29.78582+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.ProjectService/SetIamPolicy", "parent": "projects/hr", "request": "{\"resource\":\"projects/hr\", \"policy\":{\"bindings\":[{\"role\":\"roles/projectOwner\", \"members\":[\"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/projectDeveloper\", \"members\":[\"user:[email protected]\"], \"condition\":{\"title\":\"Project Developer All databases\"}}], \"etag\":\"1748242124999\"}, \"etag\":\"1748242124999\"}", "resource": "projects/hr", "response": "{\"bindings\":[{\"role\":\"roles/projectOwner\", \"members\":[\"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/projectDeveloper\", \"members\":[\"user:[email protected]\"], \"condition\":{\"title\":\"Project Developer All databases\"}}], \"etag\":\"1748246849784\"}", "severity": "INFO", "serviceData": {"@type": "type.googleapis.com/bytebase.v1.AuditData", "policyDelta": {"bindingDeltas": [{"role": "roles/projectDeveloper", "action": "ADD", "member": "users/102", "condition": {"title": "Project Developer All databases"}}]}}, "requestMetadata": {"callerIp": "[::1]:62678", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (154, '2025-05-26 08:08:54.155379+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.UserService/CreateUser", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"user\":{\"name\":\"users/0\", \"email\":\"[email protected]\", \"title\":\"QA1\", \"userType\":\"USER\"}}", "resource": "users/0", "response": "{\"name\":\"users/105\", \"email\":\"[email protected]\", \"title\":\"QA1\", \"userType\":\"USER\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (155, '2025-05-26 08:08:54.164132+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748245272807\"}, \"etag\":\"1748245272807\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748246934163\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (155, '2025-05-26 08:08:54.164132+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748245272807\"}, \"etag\":\"1748245272807\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748246934163\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (156, '2025-05-26 08:09:14.424273+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.UserService/CreateUser", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"user\":{\"name\":\"users/0\", \"email\":\"[email protected]\", \"title\":\"QA2\", \"userType\":\"USER\"}}", "resource": "users/0", "response": "{\"name\":\"users/106\", \"email\":\"[email protected]\", \"title\":\"QA2\", \"userType\":\"USER\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (157, '2025-05-26 08:09:14.43372+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748246934163\"}, \"etag\":\"1748246934163\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748246954432\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (157, '2025-05-26 08:09:14.43372+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748246934163\"}, \"etag\":\"1748246934163\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}], \"etag\":\"1748246954432\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (158, '2025-05-26 08:09:47.440116+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.GroupService/CreateGroup", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"group\":{\"name\":\"groups/[email protected]\", \"title\":\"QA Group\", \"members\":[{\"member\":\"users/[email protected]\", \"role\":\"OWNER\"}, {\"member\":\"users/[email protected]\", \"role\":\"MEMBER\"}]}, \"groupEmail\":\"[email protected]\"}", "response": "{\"name\":\"groups/[email protected]\", \"title\":\"QA Group\", \"members\":[{\"member\":\"users/[email protected]\", \"role\":\"OWNER\"}, {\"member\":\"users/[email protected]\", \"role\":\"MEMBER\"}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (159, '2025-05-26 08:10:00.959856+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/-\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\", \"group:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/qa-custom-role\", \"members\":[\"group:[email protected]\"]}], \"etag\":\"1748246954432\"}, \"etag\":\"1748246954432\"}", "resource": "workspaces/-", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\", \"group:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/qa-custom-role\", \"members\":[\"group:[email protected]\"], \"condition\":{}}], \"etag\":\"1748247000958\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;+INSERT INTO public.audit_log (id, created_at, payload) VALUES (159, '2025-05-26 08:10:00.959856+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.WorkspaceService/SetIamPolicy", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"resource\":\"workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48\", \"policy\":{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\", \"group:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/qa-custom-role\", \"members\":[\"group:[email protected]\"]}], \"etag\":\"1748246954432\"}, \"etag\":\"1748246954432\"}", "resource": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "response": "{\"bindings\":[{\"role\":\"roles/workspaceMember\", \"members\":[\"allUsers\", \"user:[email protected]\", \"user:[email protected]\", \"user:[email protected]\", \"group:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceAdmin\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/workspaceDBA\", \"members\":[\"user:[email protected]\", \"user:[email protected]\"], \"condition\":{}}, {\"role\":\"roles/qa-custom-role\", \"members\":[\"group:[email protected]\"], \"condition\":{}}], \"etag\":\"1748247000958\"}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:62675", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (160, '2025-05-26 08:14:34.184265+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.data-classification\", \"value\":{\"dataClassificationSettingValue\":{\"configs\":[{\"id\":\"e5680e79-e84b-486e-8cb2-76c984c3fac9\", \"title\":\"Classification Example\", \"levels\":[{\"id\":\"1\", \"title\":\"Level 1\"}, {\"id\":\"2\", \"title\":\"Level 2\"}, {\"id\":\"3\", \"title\":\"Level 3\"}, {\"id\":\"4\", \"title\":\"Level 4\"}], \"classification\":{\"1\":{\"id\":\"1\", \"title\":\"Basic\"}, \"1-1\":{\"id\":\"1-1\", \"title\":\"Basic\", \"levelId\":\"1\"}, \"1-2\":{\"id\":\"1-2\", \"title\":\"Contact\", \"levelId\":\"2\"}, \"1-3\":{\"id\":\"1-3\", \"title\":\"Health\", \"levelId\":\"4\"}, \"2\":{\"id\":\"2\", \"title\":\"Relationship\"}, \"2-1\":{\"id\":\"2-1\", \"title\":\"Social\", \"levelId\":\"1\"}, \"2-2\":{\"id\":\"2-2\", \"title\":\"Business\", \"levelId\":\"3\"}}, \"classificationFromConfig\":true}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.data-classification", "response": "{\"name\":\"settings/bb.workspace.data-classification\", \"value\":{\"dataClassificationSettingValue\":{\"configs\":[{\"id\":\"e5680e79-e84b-486e-8cb2-76c984c3fac9\", \"title\":\"Classification Example\", \"levels\":[{\"id\":\"1\", \"title\":\"Level 1\"}, {\"id\":\"2\", \"title\":\"Level 2\"}, {\"id\":\"3\", \"title\":\"Level 3\"}, {\"id\":\"4\", \"title\":\"Level 4\"}], \"classification\":{\"1\":{\"id\":\"1\", \"title\":\"Basic\"}, \"1-1\":{\"id\":\"1-1\", \"title\":\"Basic\", \"levelId\":\"1\"}, \"1-2\":{\"id\":\"1-2\", \"title\":\"Contact\", \"levelId\":\"2\"}, \"1-3\":{\"id\":\"1-3\", \"title\":\"Health\", \"levelId\":\"4\"}, \"2\":{\"id\":\"2\", \"title\":\"Relationship\"}, \"2-1\":{\"id\":\"2-1\", \"title\":\"Social\", \"levelId\":\"1\"}, \"2-2\":{\"id\":\"2-2\", \"title\":\"Business\", \"levelId\":\"3\"}}, \"classificationFromConfig\":true}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.data-classification", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"dataClassificationSettingValue": {"configs": [{"id": "e5680e79-e84b-486e-8cb2-76c984c3fac9", "title": "Classification Example", "levels": [{"id": "1", "title": "Level 1"}, {"id": "2", "title": "Level 2"}, {"id": "3", "title": "Level 3"}, {"id": "4", "title": "Level 4"}], "classification": {"1": {"id": "1", "title": "Basic"}, "2": {"id": "2", "title": "Relationship"}, "1-1": {"id": "1-1", "title": "Basic", "levelId": "1"}, "1-2": {"id": "1-2", "title": "Contact", "levelId": "2"}, "1-3": {"id": "1-3", "title": "Health", "levelId": "4"}, "2-1": {"id": "2-1", "title": "Social", "levelId": "1"}, "2-2": {"id": "2-2", "title": "Business", "levelId": "3"}}}]}}}, "requestMetadata": {"callerIp": "[::1]:63103", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (161, '2025-05-26 08:14:52.612657+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseCatalogService/UpdateDatabaseCatalog", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"catalog\":{\"name\":\"instances/prod-sample-instance/databases/hr_prod/catalog\", \"schemas\":[{\"name\":\"public\", \"tables\":[{\"name\":\"employee\", \"columns\":{\"columns\":[{\"name\":\"first_name\", \"classification\":\"1-2\"}]}}]}]}}", "resource": "instances/prod-sample-instance/databases/hr_prod/catalog", "response": "{\"name\":\"instances/prod-sample-instance/databases/hr_prod/catalog\", \"schemas\":[{\"name\":\"public\", \"tables\":[{\"name\":\"employee\", \"columns\":{\"columns\":[{\"name\":\"first_name\", \"classification\":\"1-2\"}]}}]}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:63103", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (162, '2025-05-26 08:14:55.969774+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseCatalogService/UpdateDatabaseCatalog", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"catalog\":{\"name\":\"instances/prod-sample-instance/databases/hr_prod/catalog\", \"schemas\":[{\"name\":\"public\", \"tables\":[{\"name\":\"employee\", \"columns\":{\"columns\":[{\"name\":\"first_name\", \"classification\":\"1-2\"}, {\"name\":\"last_name\", \"classification\":\"1-2\"}]}}]}]}}", "resource": "instances/prod-sample-instance/databases/hr_prod/catalog", "response": "{\"name\":\"instances/prod-sample-instance/databases/hr_prod/catalog\", \"schemas\":[{\"name\":\"public\", \"tables\":[{\"name\":\"employee\", \"columns\":{\"columns\":[{\"name\":\"first_name\", \"classification\":\"1-2\"}, {\"name\":\"last_name\", \"classification\":\"1-2\"}]}}]}]}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:63103", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;@@ -1419,7 +1115,6 @@ INSERT INTO public.audit_log (id, created_at, payload) VALUES (179, '2025-05-26INSERT INTO public.audit_log (id, created_at, payload) VALUES (180, '2025-05-26 08:48:05.008683+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.SettingService/UpdateSetting", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"setting\":{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200 || source == \\\"DDL\\\" &&\\nlevel == 0 || source == \\\"DML\\\" && level == 200 || source == \\\"DATA_EXPORT\\\" &&\\nlevel == 0 || source == \\\"REQUEST_QUERY\\\" && level == 0 || source == \\\"REQUEST_EXPORT\\\" &&\\nlevel == 0 || source == \\\"CREATE_DATABASE\\\" && level == 0\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}, \"allowMissing\":true}", "resource": "settings/bb.workspace.approval", "response": "{\"name\":\"settings/bb.workspace.approval\", \"value\":{\"workspaceApprovalSettingValue\":{\"rules\":[{\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Project Owner -> Workspace DBA\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 300 || source == \\\"DDL\\\" && level == 300\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}]}, \"title\":\"Project Owner\", \"description\":\"The system defines the approval process and only needs the project Owner to approve it.\", \"creator\":\"users/[email protected]\"}, \"condition\":{\"expression\":\"source == \\\"DML\\\" && level == 0 || source == \\\"DDL\\\" && level == 200 || source == \\\"DDL\\\" &&\\nlevel == 0 || source == \\\"DML\\\" && level == 200 || source == \\\"DATA_EXPORT\\\" &&\\nlevel == 0 || source == \\\"REQUEST_QUERY\\\" && level == 0 || source == \\\"REQUEST_EXPORT\\\" &&\\nlevel == 0 || source == \\\"CREATE_DATABASE\\\" && level == 0\"}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}]}, \"title\":\"Workspace DBA\", \"description\":\"The system defines the approval process and only needs DBA approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Workspace Admin\", \"description\":\"The system defines the approval process and only needs Administrator approval.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}, {\"template\":{\"flow\":{\"steps\":[{\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/projectOwner\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceDBA\"}]}, {\"type\":\"ANY\", \"nodes\":[{\"type\":\"ANY_IN_GROUP\", \"role\":\"roles/workspaceAdmin\"}]}]}, \"title\":\"Project Owner -> Workspace DBA -> Workspace Admin\", \"description\":\"The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves.\", \"creator\":\"users/[email protected]\"}, \"condition\":{}}]}}}", "severity": "INFO", "serviceData": {"name": "settings/bb.workspace.approval", "@type": "type.googleapis.com/bytebase.v1.Setting", "value": {"workspaceApprovalSettingValue": {"rules": [{"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "source == \"DML\" && level == 300 || source == \"DDL\" && level == 300"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "source == \"DML\" && level == 0 || source == \"DDL\" && level == 200 || source == \"DDL\" &&\nlevel == 0 || source == \"DML\" && level == 200 || source == \"DATA_EXPORT\" &&\nlevel == 0 || source == \"REQUEST_QUERY\" && level == 0 || source == \"REQUEST_EXPORT\" &&\nlevel == 0"}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace DBA", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs DBA approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process and only needs Administrator approval."}, "condition": {}}, {"template": {"flow": {"steps": [{"type": "ANY", "nodes": [{"role": "roles/projectOwner", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceDBA", "type": "ANY_IN_GROUP"}]}, {"type": "ANY", "nodes": [{"role": "roles/workspaceAdmin", "type": "ANY_IN_GROUP"}]}]}, "title": "Project Owner -> Workspace DBA -> Workspace Admin", "creator": "users/[email protected]", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves, and finally the Administrator approves."}, "condition": {}}]}}}, "requestMetadata": {"callerIp": "[::1]:49799", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (181, '2025-06-05 07:04:57.22349+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.AuthService/Login", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"email\":\"[email protected]\", \"web\":true}", "resource": "[email protected]", "response": "{\"user\":{\"name\":\"users/101\", \"email\":\"[email protected]\", \"title\":\"Demo\", \"userType\":\"USER\"}}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:58691", "callerSuppliedUserAgent": "grpc-go/1.72.2"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (182, '2025-06-09 02:20:35.270694+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.AuthService/Login", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "request": "{\"email\":\"[email protected]\",\"web\":true}", "resource": "[email protected]", "response": "{\"user\":{\"name\":\"users/101\",\"email\":\"[email protected]\",\"title\":\"Demo\",\"userType\":\"USER\"}}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:56360", "callerSuppliedUserAgent": "grpc-go/1.72.2"}}') ON CONFLICT DO NOTHING;-INSERT INTO public.audit_log (id, created_at, payload) VALUES (184, '2025-06-09 02:21:04.278663+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseService/UpdateDatabase", "parent": "projects/hr", "request": "{\"database\":{\"name\":\"instances/prod-sample-instance/databases/hr_prod\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.301195Z\",\"project\":\"projects/hr\",\"environment\":\"environments/prod\",\"effectiveEnvironment\":\"environments/prod\",\"instanceResource\":{\"title\":\"Prod Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"9af4f227-a55e-4e82-b7f5-c7193b5f405c\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"},{\"id\":\"e700ae12-173e-4f0d-8590-0414cf6a9405\",\"type\":\"READ_ONLY\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/prod-sample-instance\",\"environment\":\"environments/prod\"},\"backupAvailable\":true},\"updateMask\":\"drifted\"}", "resource": "instances/prod-sample-instance/databases/hr_prod", "response": "{\"name\":\"instances/prod-sample-instance/databases/hr_prod\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.301195Z\",\"project\":\"projects/hr\",\"effectiveEnvironment\":\"environments/prod\",\"instanceResource\":{\"title\":\"Prod Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"9af4f227-a55e-4e82-b7f5-c7193b5f405c\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"},{\"id\":\"e700ae12-173e-4f0d-8590-0414cf6a9405\",\"type\":\"READ_ONLY\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/prod-sample-instance\",\"environment\":\"environments/prod\"},\"backupAvailable\":true}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:56354", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (185, '2025-06-09 02:21:07.597633+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseService/UpdateDatabase", "parent": "projects/hr", "request": "{\"database\":{\"name\":\"instances/test-sample-instance/databases/hr_test\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.306591Z\",\"project\":\"projects/hr\",\"environment\":\"environments/test\",\"effectiveEnvironment\":\"environments/test\",\"instanceResource\":{\"title\":\"Test Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8083\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/test-sample-instance\",\"environment\":\"environments/test\"},\"backupAvailable\":true},\"updateMask\":\"drifted\"}", "resource": "instances/test-sample-instance/databases/hr_test", "response": "{\"name\":\"instances/test-sample-instance/databases/hr_test\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.306591Z\",\"project\":\"projects/hr\",\"effectiveEnvironment\":\"environments/test\",\"instanceResource\":{\"title\":\"Test Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"a7f206f9-37c4-41ca-8b59-fcf4c6148105\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8083\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/test-sample-instance\",\"environment\":\"environments/test\"},\"backupAvailable\":true}", "severity": "INFO", "requestMetadata": {"callerIp": "[::1]:56353", "callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (186, '2025-09-09 03:25:51.338104+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.AuthService/Login", "parent": "workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48", "latency": "0.092258458s", "request": "{\"email\":\"[email protected]\",\"web\":true}", "resource": "[email protected]", "response": "{\"user\":{\"name\":\"users/101\",\"email\":\"[email protected]\",\"title\":\"Demo\",\"userType\":\"USER\"}}", "severity": "INFO", "requestMetadata": {"callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;INSERT INTO public.audit_log (id, created_at, payload) VALUES (187, '2025-09-09 03:27:04.928131+00', '{"user": "users/[email protected]", "method": "/bytebase.v1.DatabaseService/UpdateDatabase", "parent": "projects/hr", "latency": "0.045281250s", "request": "{\"database\":{\"name\":\"instances/prod-sample-instance/databases/hr_prod\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-06-05T07:08:02.301195Z\",\"project\":\"projects/hr\",\"environment\":\"environments/prod\",\"effectiveEnvironment\":\"environments/prod\",\"instanceResource\":{\"title\":\"Prod Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"9af4f227-a55e-4e82-b7f5-c7193b5f405c\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"},{\"id\":\"e700ae12-173e-4f0d-8590-0414cf6a9405\",\"type\":\"READ_ONLY\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/prod-sample-instance\",\"environment\":\"environments/prod\"},\"backupAvailable\":true},\"updateMask\":\"drifted\"}", "resource": "instances/prod-sample-instance/databases/hr_prod", "response": "{\"name\":\"instances/prod-sample-instance/databases/hr_prod\",\"state\":\"ACTIVE\",\"successfulSyncTime\":\"2025-09-09T03:27:04.921330Z\",\"project\":\"projects/hr\",\"effectiveEnvironment\":\"environments/prod\",\"instanceResource\":{\"title\":\"Prod Sample Instance\",\"engine\":\"POSTGRES\",\"engineVersion\":\"16.0.0\",\"dataSources\":[{\"id\":\"9af4f227-a55e-4e82-b7f5-c7193b5f405c\",\"type\":\"ADMIN\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"},{\"id\":\"e700ae12-173e-4f0d-8590-0414cf6a9405\",\"type\":\"READ_ONLY\",\"username\":\"bbsample\",\"host\":\"/tmp\",\"port\":\"8084\",\"authenticationType\":\"PASSWORD\",\"redisType\":\"STANDALONE\"}],\"activation\":true,\"name\":\"instances/prod-sample-instance\",\"environment\":\"environments/prod\"},\"backupAvailable\":true}", "severity": "INFO", "requestMetadata": {"callerSuppliedUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"}}') ON CONFLICT DO NOTHING;@@ -1448,12 +1143,12 @@ INSERT INTO public.changelog (id, created_at, instance, db_name, status, sync_hi-- Data for Name: db; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.db (id, deleted, project, instance, name, environment, metadata) VALUES (105, false, 'default', 'prod-sample-instance', 'postgres', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.311361Z"}') ON CONFLICT DO NOTHING;-INSERT INTO public.db (id, deleted, project, instance, name, environment, metadata) VALUES (102, false, 'metadb', 'bytebase-meta', 'bb', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.312662Z"}') ON CONFLICT DO NOTHING;-INSERT INTO public.db (id, deleted, project, instance, name, environment, metadata) VALUES (103, false, 'default', 'test-sample-instance', 'postgres', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.313191Z"}') ON CONFLICT DO NOTHING;-INSERT INTO public.db (id, deleted, project, instance, name, environment, metadata) VALUES (101, false, 'default', 'bytebase-meta', 'postgres', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.316233Z"}') ON CONFLICT DO NOTHING;-INSERT INTO public.db (id, deleted, project, instance, name, environment, metadata) VALUES (106, false, 'hr', 'prod-sample-instance', 'hr_prod', NULL, '{"lastSyncTime": "2025-10-10T07:15:40.832105Z", "backupAvailable": true}') ON CONFLICT DO NOTHING;-INSERT INTO public.db (id, deleted, project, instance, name, environment, metadata) VALUES (104, false, 'hr', 'test-sample-instance', 'hr_test', NULL, '{"lastSyncTime": "2025-10-10T07:15:45.139052Z", "backupAvailable": true}') ON CONFLICT DO NOTHING;+INSERT INTO public.db (deleted, project, instance, name, environment, metadata) VALUES (false, 'default', 'prod-sample-instance', 'postgres', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.311361Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.db (deleted, project, instance, name, environment, metadata) VALUES (false, 'metadb', 'bytebase-meta', 'bb', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.312662Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.db (deleted, project, instance, name, environment, metadata) VALUES (false, 'default', 'test-sample-instance', 'postgres', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.313191Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.db (deleted, project, instance, name, environment, metadata) VALUES (false, 'default', 'bytebase-meta', 'postgres', NULL, '{"lastSyncTime": "2025-06-05T07:08:02.316233Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.db (deleted, project, instance, name, environment, metadata) VALUES (false, 'hr', 'prod-sample-instance', 'hr_prod', NULL, '{"lastSyncTime": "2025-10-10T07:15:40.832105Z", "backupAvailable": true}') ON CONFLICT DO NOTHING;+INSERT INTO public.db (deleted, project, instance, name, environment, metadata) VALUES (false, 'hr', 'test-sample-instance', 'hr_test', NULL, '{"lastSyncTime": "2025-10-10T07:15:45.139052Z", "backupAvailable": true}') ON CONFLICT DO NOTHING;--@@ -1466,7 +1161,7 @@ INSERT INTO public.db (id, deleted, project, instance, name, environment, metada-- Data for Name: db_schema; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.db_schema (id, instance, db_name, metadata, raw_dump, config) VALUES (102, 'bytebase-meta', 'bb', '{"name":"bb","schemas":[{"name":"public","tables":[{"name":"audit_log","columns":[{"name":"id","position":1,"default":"nextval(''public.audit_log_id_seq''::regclass)","type":"bigint"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"payload","position":3,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"audit_log_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX audit_log_pkey ON public.audit_log USING btree (id);","isConstraint":true},{"name":"idx_audit_log_created_at","expressions":["created_at"],"type":"btree","definition":"CREATE INDEX idx_audit_log_created_at ON public.audit_log USING btree (created_at);"},{"name":"idx_audit_log_payload_method","expressions":["payload ->> ''method''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_method ON public.audit_log USING btree (((payload ->> ''method''::text)));"},{"name":"idx_audit_log_payload_parent","expressions":["payload ->> ''parent''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_parent ON public.audit_log USING btree (((payload ->> ''parent''::text)));"},{"name":"idx_audit_log_payload_resource","expressions":["payload ->> ''resource''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_resource ON public.audit_log USING btree (((payload ->> ''resource''::text)));"},{"name":"idx_audit_log_payload_user","expressions":["payload ->> ''user''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_user ON public.audit_log USING btree (((payload ->> ''user''::text)));"}],"rowCount":"81","dataSize":"139264","indexSize":"98304","owner":"bb"},{"name":"changelist","columns":[{"name":"id","position":1,"default":"nextval(''public.changelist_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"updated_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"changelist_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX changelist_pkey ON public.changelist USING btree (id);","isConstraint":true},{"name":"idx_changelist_project_name","expressions":["project","name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_changelist_project_name ON public.changelist USING btree (project, name);"}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"changelist_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"changelist_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"changelog","columns":[{"name":"id","position":1,"default":"nextval(''public.changelog_id_seq''::regclass)","type":"bigint"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"instance","position":3,"type":"text"},{"name":"db_name","position":4,"type":"text"},{"name":"status","position":5,"type":"text"},{"name":"prev_sync_history_id","position":6,"nullable":true,"type":"bigint"},{"name":"sync_history_id","position":7,"nullable":true,"type":"bigint"},{"name":"payload","position":8,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"changelog_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX changelog_pkey ON public.changelog USING btree (id);","isConstraint":true},{"name":"idx_changelog_instance_db_name","expressions":["instance","db_name"],"type":"btree","definition":"CREATE INDEX idx_changelog_instance_db_name ON public.changelog USING btree (instance, db_name);"}],"rowCount":"2","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"changelog_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"changelog_prev_sync_history_id_fkey","columns":["prev_sync_history_id"],"referencedSchema":"public","referencedTable":"sync_history","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"changelog_sync_history_id_fkey","columns":["sync_history_id"],"referencedSchema":"public","referencedTable":"sync_history","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"changelog_status_check","expression":"(status = ANY (ARRAY[''PENDING''::text, ''DONE''::text, ''FAILED''::text]))"}],"owner":"bb"},{"name":"data_source","columns":[{"name":"id","position":1,"default":"nextval(''public.data_source_id_seq''::regclass)","type":"integer"},{"name":"instance","position":2,"type":"text"},{"name":"options","position":3,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"data_source_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX data_source_pkey ON public.data_source USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"8192","foreignKeys":[{"name":"data_source_instance_fkey","columns":["instance"],"referencedSchema":"public","referencedTable":"instance","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"db","columns":[{"name":"id","position":1,"default":"nextval(''public.db_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"project","position":3,"type":"text"},{"name":"instance","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"environment","position":6,"nullable":true,"type":"text"},{"name":"metadata","position":7,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"db_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX db_pkey ON public.db USING btree (id);","isConstraint":true},{"name":"idx_db_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_db_project ON public.db USING btree (project);"},{"name":"idx_db_unique_instance_name","expressions":["instance","name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_unique_instance_name ON public.db USING btree (instance, name);"}],"rowCount":"6","dataSize":"16384","indexSize":"49152","foreignKeys":[{"name":"db_instance_fkey","columns":["instance"],"referencedSchema":"public","referencedTable":"instance","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"db_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"db_group","columns":[{"name":"id","position":1,"default":"nextval(''public.db_group_id_seq''::regclass)","type":"bigint"},{"name":"project","position":2,"type":"text"},{"name":"resource_id","position":3,"type":"text"},{"name":"placeholder","position":4,"default":"''''::text","type":"text"},{"name":"expression","position":5,"default":"''{}''::jsonb","type":"jsonb"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"db_group_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX db_group_pkey ON public.db_group USING btree (id);","isConstraint":true},{"name":"idx_db_group_unique_project_placeholder","expressions":["project","placeholder"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_group_unique_project_placeholder ON public.db_group USING btree (project, placeholder);"},{"name":"idx_db_group_unique_project_resource_id","expressions":["project","resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_group_unique_project_resource_id ON public.db_group USING btree (project, resource_id);"}],"dataSize":"8192","indexSize":"24576","foreignKeys":[{"name":"db_group_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"db_schema","columns":[{"name":"id","position":1,"default":"nextval(''public.db_schema_id_seq''::regclass)","type":"integer"},{"name":"instance","position":2,"type":"text"},{"name":"db_name","position":3,"type":"text"},{"name":"metadata","position":4,"default":"''{}''::json","type":"json"},{"name":"raw_dump","position":5,"default":"''''::text","type":"text"},{"name":"config","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"db_schema_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX db_schema_pkey ON public.db_schema USING btree (id);","isConstraint":true},{"name":"idx_db_schema_unique_instance_db_name","expressions":["instance","db_name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_schema_unique_instance_db_name ON public.db_schema USING btree (instance, db_name);"}],"rowCount":"6","dataSize":"73728","indexSize":"32768","foreignKeys":[{"name":"db_schema_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"export_archive","columns":[{"name":"id","position":1,"default":"nextval(''public.export_archive_id_seq''::regclass)","type":"integer"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"bytes","position":3,"nullable":true,"type":"bytea"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"export_archive_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX export_archive_pkey ON public.export_archive USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"8192","owner":"bb"},{"name":"idp","columns":[{"name":"id","position":1,"default":"nextval(''public.idp_id_seq''::regclass)","type":"integer"},{"name":"resource_id","position":2,"type":"text"},{"name":"name","position":3,"type":"text"},{"name":"domain","position":4,"type":"text"},{"name":"type","position":5,"type":"text"},{"name":"config","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idp_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX idp_pkey ON public.idp USING btree (id);","isConstraint":true},{"name":"idx_idp_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_idp_unique_resource_id ON public.idp USING btree (resource_id);"}],"dataSize":"8192","indexSize":"16384","checkConstraints":[{"name":"idp_type_check","expression":"(type = ANY (ARRAY[''OAUTH2''::text, ''OIDC''::text, ''LDAP''::text]))"}],"owner":"bb"},{"name":"instance","columns":[{"name":"id","position":1,"default":"nextval(''public.instance_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"environment","position":3,"nullable":true,"type":"text"},{"name":"resource_id","position":4,"type":"text"},{"name":"metadata","position":5,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_instance_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_instance_unique_resource_id ON public.instance USING btree (resource_id);"},{"name":"instance_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX instance_pkey ON public.instance USING btree (id);","isConstraint":true}],"rowCount":"3","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"instance_change_history","columns":[{"name":"id","position":1,"default":"nextval(''public.instance_change_history_id_seq''::regclass)","type":"bigint"},{"name":"version","position":2,"type":"text"}],"indexes":[{"name":"idx_instance_change_history_unique_version","expressions":["version"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_instance_change_history_unique_version ON public.instance_change_history USING btree (version);"},{"name":"instance_change_history_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX instance_change_history_pkey ON public.instance_change_history USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"issue","columns":[{"name":"id","position":1,"default":"nextval(''public.issue_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":5,"type":"text"},{"name":"plan_id","position":6,"nullable":true,"type":"bigint"},{"name":"pipeline_id","position":7,"nullable":true,"type":"integer"},{"name":"name","position":8,"type":"text"},{"name":"status","position":9,"type":"text"},{"name":"type","position":10,"type":"text"},{"name":"description","position":11,"default":"''''::text","type":"text"},{"name":"payload","position":12,"default":"''{}''::jsonb","type":"jsonb"},{"name":"ts_vector","position":13,"nullable":true,"type":"tsvector"}],"indexes":[{"name":"idx_issue_creator_id","expressions":["creator_id"],"type":"btree","definition":"CREATE INDEX idx_issue_creator_id ON public.issue USING btree (creator_id);"},{"name":"idx_issue_pipeline_id","expressions":["pipeline_id"],"type":"btree","definition":"CREATE INDEX idx_issue_pipeline_id ON public.issue USING btree (pipeline_id);"},{"name":"idx_issue_plan_id","expressions":["plan_id"],"type":"btree","definition":"CREATE INDEX idx_issue_plan_id ON public.issue USING btree (plan_id);"},{"name":"idx_issue_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_issue_project ON public.issue USING btree (project);"},{"name":"idx_issue_ts_vector","expressions":["ts_vector"],"type":"gin","definition":"CREATE INDEX idx_issue_ts_vector ON public.issue USING gin (ts_vector);"},{"name":"issue_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX issue_pkey ON public.issue USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"98304","foreignKeys":[{"name":"issue_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_pipeline_id_fkey","columns":["pipeline_id"],"referencedSchema":"public","referencedTable":"pipeline","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_plan_id_fkey","columns":["plan_id"],"referencedSchema":"public","referencedTable":"plan","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"issue_status_check","expression":"(status = ANY (ARRAY[''OPEN''::text, ''DONE''::text, ''CANCELED''::text]))"}],"owner":"bb"},{"name":"issue_comment","columns":[{"name":"id","position":1,"default":"nextval(''public.issue_comment_id_seq''::regclass)","type":"bigint"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"issue_id","position":5,"type":"integer"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_issue_comment_issue_id","expressions":["issue_id"],"type":"btree","definition":"CREATE INDEX idx_issue_comment_issue_id ON public.issue_comment USING btree (issue_id);"},{"name":"issue_comment_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX issue_comment_pkey ON public.issue_comment USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"issue_comment_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_comment_issue_id_fkey","columns":["issue_id"],"referencedSchema":"public","referencedTable":"issue","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"issue_subscriber","columns":[{"name":"issue_id","position":1,"type":"integer"},{"name":"subscriber_id","position":2,"type":"integer"}],"indexes":[{"name":"idx_issue_subscriber_subscriber_id","expressions":["subscriber_id"],"type":"btree","definition":"CREATE INDEX idx_issue_subscriber_subscriber_id ON public.issue_subscriber USING btree (subscriber_id);"},{"name":"issue_subscriber_pkey","expressions":["issue_id","subscriber_id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX issue_subscriber_pkey ON public.issue_subscriber USING btree (issue_id, subscriber_id);","isConstraint":true}],"indexSize":"16384","foreignKeys":[{"name":"issue_subscriber_issue_id_fkey","columns":["issue_id"],"referencedSchema":"public","referencedTable":"issue","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_subscriber_subscriber_id_fkey","columns":["subscriber_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"pipeline","columns":[{"name":"id","position":1,"default":"nextval(''public.pipeline_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":4,"type":"text"},{"name":"name","position":5,"type":"text"}],"indexes":[{"name":"pipeline_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX pipeline_pkey ON public.pipeline USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","foreignKeys":[{"name":"pipeline_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"pipeline_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"plan","columns":[{"name":"id","position":1,"default":"nextval(''public.plan_id_seq''::regclass)","type":"bigint"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":5,"type":"text"},{"name":"pipeline_id","position":6,"nullable":true,"type":"integer"},{"name":"name","position":7,"type":"text"},{"name":"description","position":8,"type":"text"},{"name":"config","position":9,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_plan_pipeline_id","expressions":["pipeline_id"],"type":"btree","definition":"CREATE INDEX idx_plan_pipeline_id ON public.plan USING btree (pipeline_id);"},{"name":"idx_plan_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_plan_project ON public.plan USING btree (project);"},{"name":"plan_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX plan_pkey ON public.plan USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"49152","foreignKeys":[{"name":"plan_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"plan_pipeline_id_fkey","columns":["pipeline_id"],"referencedSchema":"public","referencedTable":"pipeline","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"plan_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"plan_check_run","columns":[{"name":"id","position":1,"default":"nextval(''public.plan_check_run_id_seq''::regclass)","type":"integer"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"plan_id","position":4,"type":"bigint"},{"name":"status","position":5,"type":"text"},{"name":"type","position":6,"type":"text"},{"name":"config","position":7,"default":"''{}''::jsonb","type":"jsonb"},{"name":"result","position":8,"default":"''{}''::jsonb","type":"jsonb"},{"name":"payload","position":9,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_plan_check_run_plan_id","expressions":["plan_id"],"type":"btree","definition":"CREATE INDEX idx_plan_check_run_plan_id ON public.plan_check_run USING btree (plan_id);"},{"name":"plan_check_run_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX plan_check_run_pkey ON public.plan_check_run USING btree (id);","isConstraint":true}],"rowCount":"6","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"plan_check_run_plan_id_fkey","columns":["plan_id"],"referencedSchema":"public","referencedTable":"plan","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"plan_check_run_status_check","expression":"(status = ANY (ARRAY[''RUNNING''::text, ''DONE''::text, ''FAILED''::text, ''CANCELED''::text]))"},{"name":"plan_check_run_type_check","expression":"(type ~~ ''bb.plan-check.%''::text)"}],"owner":"bb"},{"name":"policy","columns":[{"name":"id","position":1,"default":"nextval(''public.policy_id_seq''::regclass)","type":"integer"},{"name":"enforce","position":2,"default":"true","type":"boolean"},{"name":"updated_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"resource_type","position":4,"type":"text"},{"name":"resource","position":5,"type":"text"},{"name":"type","position":6,"type":"text"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"},{"name":"inherit_from_parent","position":8,"default":"true","type":"boolean"}],"indexes":[{"name":"idx_policy_unique_resource_type_resource_type","expressions":["resource_type","resource","type"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_type ON public.policy USING btree (resource_type, resource, type);"},{"name":"policy_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX policy_pkey ON public.policy USING btree (id);","isConstraint":true}],"rowCount":"8","dataSize":"16384","indexSize":"32768","checkConstraints":[{"name":"policy_resource_type_check","expression":"(resource_type = ANY (ARRAY[''WORKSPACE''::text, ''ENVIRONMENT''::text, ''PROJECT''::text, ''INSTANCE''::text]))"}],"owner":"bb"},{"name":"principal","columns":[{"name":"id","position":1,"default":"nextval(''public.principal_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"type","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"email","position":6,"type":"text"},{"name":"password_hash","position":7,"type":"text"},{"name":"phone","position":8,"default":"''''::text","type":"text"},{"name":"mfa_config","position":9,"default":"''{}''::jsonb","type":"jsonb"},{"name":"profile","position":10,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"principal_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX principal_pkey ON public.principal USING btree (id);","isConstraint":true}],"rowCount":"7","dataSize":"16384","indexSize":"16384","checkConstraints":[{"name":"principal_type_check","expression":"(type = ANY (ARRAY[''END_USER''::text, ''SYSTEM_BOT''::text, ''SERVICE_ACCOUNT''::text]))"}],"owner":"bb"},{"name":"project","columns":[{"name":"id","position":1,"default":"nextval(''public.project_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"name","position":3,"type":"text"},{"name":"resource_id","position":4,"type":"text"},{"name":"data_classification_config_id","position":5,"default":"''''::text","type":"text"},{"name":"setting","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_project_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_project_unique_resource_id ON public.project USING btree (resource_id);"},{"name":"project_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX project_pkey ON public.project USING btree (id);","isConstraint":true}],"rowCount":"3","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"project_webhook","columns":[{"name":"id","position":1,"default":"nextval(''public.project_webhook_id_seq''::regclass)","type":"integer"},{"name":"project","position":2,"type":"text"},{"name":"type","position":3,"type":"text"},{"name":"name","position":4,"type":"text"},{"name":"url","position":5,"type":"text"},{"name":"event_list","position":6,"type":"_text"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_project_webhook_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_project_webhook_project ON public.project_webhook USING btree (project);"},{"name":"project_webhook_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX project_webhook_pkey ON public.project_webhook USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"project_webhook_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"project_webhook_type_check","expression":"(type ~~ ''bb.plugin.webhook.%''::text)"}],"owner":"bb"},{"name":"query_history","columns":[{"name":"id","position":1,"default":"nextval(''public.query_history_id_seq''::regclass)","type":"bigint"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project_id","position":4,"type":"text"},{"name":"database","position":5,"type":"text"},{"name":"statement","position":6,"type":"text"},{"name":"type","position":7,"type":"text"},{"name":"payload","position":8,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_query_history_creator_id_created_at_project_id","expressions":["creator_id","created_at","project_id"],"type":"btree","definition":"CREATE INDEX idx_query_history_creator_id_created_at_project_id ON public.query_history USING btree (creator_id, created_at, project_id DESC);"},{"name":"query_history_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX query_history_pkey ON public.query_history USING btree (id);","isConstraint":true}],"rowCount":"5","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"query_history_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"release","columns":[{"name":"id","position":1,"default":"nextval(''public.release_id_seq''::regclass)","type":"bigint"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"project","position":3,"type":"text"},{"name":"creator_id","position":4,"type":"integer"},{"name":"created_at","position":5,"default":"now()","type":"timestamp with time zone"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_release_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_release_project ON public.release USING btree (project);"},{"name":"release_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX release_pkey ON public.release USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"release_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"release_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"review_config","columns":[{"name":"id","position":1,"type":"text"},{"name":"enabled","position":2,"default":"true","type":"boolean"},{"name":"name","position":3,"type":"text"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"review_config_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX review_config_pkey ON public.review_config USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","owner":"bb"},{"name":"revision","columns":[{"name":"id","position":1,"default":"nextval(''public.revision_id_seq''::regclass)","type":"bigint"},{"name":"instance","position":2,"type":"text"},{"name":"db_name","position":3,"type":"text"},{"name":"created_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"deleter_id","position":5,"nullable":true,"type":"integer"},{"name":"deleted_at","position":6,"nullable":true,"type":"timestamp with time zone"},{"name":"version","position":7,"type":"text"},{"name":"payload","position":8,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_revision_instance_db_name_version","expressions":["instance","db_name","version"],"type":"btree","definition":"CREATE INDEX idx_revision_instance_db_name_version ON public.revision USING btree (instance, db_name, version);"},{"name":"idx_revision_unique_instance_db_name_version_deleted_at_null","expressions":["instance","db_name","version"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_revision_unique_instance_db_name_version_deleted_at_null ON public.revision USING btree (instance, db_name, version) WHERE (deleted_at IS NULL);"},{"name":"revision_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX revision_pkey ON public.revision USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"24576","foreignKeys":[{"name":"revision_deleter_id_fkey","columns":["deleter_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"revision_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"risk","columns":[{"name":"id","position":1,"default":"nextval(''public.risk_id_seq''::regclass)","type":"bigint"},{"name":"source","position":2,"type":"text"},{"name":"level","position":3,"type":"bigint"},{"name":"name","position":4,"type":"text"},{"name":"active","position":5,"type":"boolean"},{"name":"expression","position":6,"type":"jsonb"}],"indexes":[{"name":"risk_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX risk_pkey ON public.risk USING btree (id);","isConstraint":true}],"rowCount":"3","dataSize":"16384","indexSize":"16384","checkConstraints":[{"name":"risk_source_check","expression":"(source ~~ ''bb.risk.%''::text)"}],"owner":"bb"},{"name":"role","columns":[{"name":"id","position":1,"default":"nextval(''public.role_id_seq''::regclass)","type":"bigint"},{"name":"resource_id","position":2,"type":"text"},{"name":"name","position":3,"type":"text"},{"name":"description","position":4,"type":"text"},{"name":"permissions","position":5,"default":"''{}''::jsonb","type":"jsonb"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_role_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_role_unique_resource_id ON public.role USING btree (resource_id);"},{"name":"role_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX role_pkey ON public.role USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"setting","columns":[{"name":"id","position":1,"default":"nextval(''public.setting_id_seq''::regclass)","type":"integer"},{"name":"name","position":2,"type":"text"},{"name":"value","position":3,"type":"text"}],"indexes":[{"name":"idx_setting_unique_name","expressions":["name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_setting_unique_name ON public.setting USING btree (name);"},{"name":"setting_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX setting_pkey ON public.setting USING btree (id);","isConstraint":true}],"rowCount":"14","dataSize":"49152","indexSize":"32768","owner":"bb"},{"name":"sheet","columns":[{"name":"id","position":1,"default":"nextval(''public.sheet_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"sha256","position":6,"type":"bytea"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_sheet_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_sheet_project ON public.sheet USING btree (project);"},{"name":"sheet_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX sheet_pkey ON public.sheet USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"sheet_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"sheet_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"sheet_blob","columns":[{"name":"sha256","position":1,"type":"bytea"},{"name":"content","position":2,"type":"text"}],"indexes":[{"name":"sheet_blob_pkey","expressions":["sha256"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX sheet_blob_pkey ON public.sheet_blob USING btree (sha256);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","owner":"bb"},{"name":"sync_history","columns":[{"name":"id","position":1,"default":"nextval(''public.sync_history_id_seq''::regclass)","type":"bigint"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"instance","position":3,"type":"text"},{"name":"db_name","position":4,"type":"text"},{"name":"metadata","position":5,"default":"''{}''::json","type":"json"},{"name":"raw_dump","position":6,"default":"''''::text","type":"text"}],"indexes":[{"name":"idx_sync_history_instance_db_name_created_at","expressions":["instance","db_name","created_at"],"type":"btree","definition":"CREATE INDEX idx_sync_history_instance_db_name_created_at ON public.sync_history USING btree (instance, db_name, created_at);"},{"name":"sync_history_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX sync_history_pkey ON public.sync_history USING btree (id);","isConstraint":true}],"rowCount":"2","dataSize":"32768","indexSize":"32768","foreignKeys":[{"name":"sync_history_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"task","columns":[{"name":"id","position":1,"default":"nextval(''public.task_id_seq''::regclass)","type":"integer"},{"name":"pipeline_id","position":2,"type":"integer"},{"name":"instance","position":4,"type":"text"},{"name":"db_name","position":5,"nullable":true,"type":"text"},{"name":"type","position":6,"type":"text"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"},{"name":"environment","position":9,"nullable":true,"type":"text"}],"indexes":[{"name":"idx_task_pipeline_id_environment","expressions":["pipeline_id","environment"],"type":"btree","definition":"CREATE INDEX idx_task_pipeline_id_environment ON public.task USING btree (pipeline_id, environment);"},{"name":"task_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX task_pkey ON public.task USING btree (id);","isConstraint":true}],"rowCount":"2","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"task_instance_fkey","columns":["instance"],"referencedSchema":"public","referencedTable":"instance","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"task_pipeline_id_fkey","columns":["pipeline_id"],"referencedSchema":"public","referencedTable":"pipeline","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"task_run","columns":[{"name":"id","position":1,"default":"nextval(''public.task_run_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"task_id","position":5,"type":"integer"},{"name":"sheet_id","position":6,"nullable":true,"type":"integer"},{"name":"attempt","position":7,"type":"integer"},{"name":"status","position":8,"type":"text"},{"name":"started_at","position":9,"nullable":true,"type":"timestamp with time zone"},{"name":"code","position":10,"default":"0","type":"integer"},{"name":"result","position":11,"default":"''{}''::jsonb","type":"jsonb"},{"name":"run_at","position":12,"nullable":true,"type":"timestamp with time zone"}],"indexes":[{"name":"idx_task_run_task_id","expressions":["task_id"],"type":"btree","definition":"CREATE INDEX idx_task_run_task_id ON public.task_run USING btree (task_id);"},{"name":"task_run_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX task_run_pkey ON public.task_run USING btree (id);","isConstraint":true},{"name":"uk_task_run_task_id_attempt","expressions":["task_id","attempt"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX uk_task_run_task_id_attempt ON public.task_run USING btree (task_id, attempt);"}],"dataSize":"8192","indexSize":"24576","foreignKeys":[{"name":"task_run_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"task_run_sheet_id_fkey","columns":["sheet_id"],"referencedSchema":"public","referencedTable":"sheet","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"task_run_task_id_fkey","columns":["task_id"],"referencedSchema":"public","referencedTable":"task","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"task_run_status_check","expression":"(status = ANY (ARRAY[''PENDING''::text, ''RUNNING''::text, ''DONE''::text, ''FAILED''::text, ''CANCELED''::text]))"}],"owner":"bb"},{"name":"task_run_log","columns":[{"name":"id","position":1,"default":"nextval(''public.task_run_log_id_seq''::regclass)","type":"bigint"},{"name":"task_run_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_task_run_log_task_run_id","expressions":["task_run_id"],"type":"btree","definition":"CREATE INDEX idx_task_run_log_task_run_id ON public.task_run_log USING btree (task_run_id);"},{"name":"task_run_log_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX task_run_log_pkey ON public.task_run_log USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"task_run_log_task_run_id_fkey","columns":["task_run_id"],"referencedSchema":"public","referencedTable":"task_run","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"user_group","columns":[{"name":"email","position":1,"type":"text"},{"name":"name","position":2,"type":"text"},{"name":"description","position":3,"default":"''''::text","type":"text"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"user_group_pkey","expressions":["email"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX user_group_pkey ON public.user_group USING btree (email);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","owner":"bb"},{"name":"worksheet","columns":[{"name":"id","position":1,"default":"nextval(''public.worksheet_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":5,"type":"text"},{"name":"instance","position":6,"nullable":true,"type":"text"},{"name":"db_name","position":7,"nullable":true,"type":"text"},{"name":"name","position":8,"type":"text"},{"name":"statement","position":9,"type":"text"},{"name":"visibility","position":10,"type":"text"},{"name":"payload","position":11,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_worksheet_creator_id_project","expressions":["creator_id","project"],"type":"btree","definition":"CREATE INDEX idx_worksheet_creator_id_project ON public.worksheet USING btree (creator_id, project);"},{"name":"worksheet_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX worksheet_pkey ON public.worksheet USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"worksheet_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"worksheet_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"worksheet_organizer","columns":[{"name":"id","position":1,"default":"nextval(''public.worksheet_organizer_id_seq''::regclass)","type":"integer"},{"name":"worksheet_id","position":2,"type":"integer"},{"name":"principal_id","position":3,"type":"integer"},{"name":"starred","position":4,"default":"false","type":"boolean"}],"indexes":[{"name":"idx_worksheet_organizer_principal_id","expressions":["principal_id"],"type":"btree","definition":"CREATE INDEX idx_worksheet_organizer_principal_id ON public.worksheet_organizer USING btree (principal_id);"},{"name":"idx_worksheet_organizer_unique_sheet_id_principal_id","expressions":["worksheet_id","principal_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_worksheet_organizer_unique_sheet_id_principal_id ON public.worksheet_organizer USING btree (worksheet_id, principal_id);"},{"name":"worksheet_organizer_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX worksheet_organizer_pkey ON public.worksheet_organizer USING btree (id);","isConstraint":true}],"indexSize":"24576","foreignKeys":[{"name":"worksheet_organizer_principal_id_fkey","columns":["principal_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"worksheet_organizer_worksheet_id_fkey","columns":["worksheet_id"],"referencedSchema":"public","referencedTable":"worksheet","referencedColumns":["id"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"}],"sequences":[{"name":"audit_log_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"181","ownerTable":"audit_log","ownerColumn":"id"},{"name":"changelist_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"changelist","ownerColumn":"id"},{"name":"changelog_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"changelog","ownerColumn":"id"},{"name":"data_source_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"data_source","ownerColumn":"id"},{"name":"db_group_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"db_group","ownerColumn":"id"},{"name":"db_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"106","ownerTable":"db","ownerColumn":"id"},{"name":"db_schema_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"108","ownerTable":"db_schema","ownerColumn":"id"},{"name":"export_archive_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"export_archive","ownerColumn":"id"},{"name":"idp_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"idp","ownerColumn":"id"},{"name":"instance_change_history_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"123","ownerTable":"instance_change_history","ownerColumn":"id"},{"name":"instance_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"103","ownerTable":"instance","ownerColumn":"id"},{"name":"issue_comment_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"issue_comment","ownerColumn":"id"},{"name":"issue_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"issue","ownerColumn":"id"},{"name":"pipeline_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"pipeline","ownerColumn":"id"},{"name":"plan_check_run_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"106","ownerTable":"plan_check_run","ownerColumn":"id"},{"name":"plan_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"plan","ownerColumn":"id"},{"name":"policy_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"111","ownerTable":"policy","ownerColumn":"id"},{"name":"principal_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"106","ownerTable":"principal","ownerColumn":"id"},{"name":"project_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"project","ownerColumn":"id"},{"name":"project_webhook_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"project_webhook","ownerColumn":"id"},{"name":"query_history_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"105","ownerTable":"query_history","ownerColumn":"id"},{"name":"release_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"release","ownerColumn":"id"},{"name":"revision_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"revision","ownerColumn":"id"},{"name":"risk_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"103","ownerTable":"risk","ownerColumn":"id"},{"name":"role_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"role","ownerColumn":"id"},{"name":"setting_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"139","ownerTable":"setting","ownerColumn":"id"},{"name":"sheet_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"sheet","ownerColumn":"id"},{"name":"sync_history_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"sync_history","ownerColumn":"id"},{"name":"task_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"task","ownerColumn":"id"},{"name":"task_run_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"task_run","ownerColumn":"id"},{"name":"task_run_log_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"task_run_log","ownerColumn":"id"},{"name":"worksheet_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"worksheet","ownerColumn":"id"},{"name":"worksheet_organizer_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"worksheet_organizer","ownerColumn":"id"}],"owner":"pg_database_owner"}],"characterSet":"UTF8","collation":"en_US.UTF-8","owner":"bb","searchPath":"\"$user\", public"}', '+INSERT INTO public.db_schema (instance, db_name, metadata, raw_dump, config) VALUES ('bytebase-meta', 'bb', '{"name":"bb","schemas":[{"name":"public","tables":[{"name":"audit_log","columns":[{"name":"id","position":1,"default":"nextval(''public.audit_log_id_seq''::regclass)","type":"bigint"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"payload","position":3,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"audit_log_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX audit_log_pkey ON public.audit_log USING btree (id);","isConstraint":true},{"name":"idx_audit_log_created_at","expressions":["created_at"],"type":"btree","definition":"CREATE INDEX idx_audit_log_created_at ON public.audit_log USING btree (created_at);"},{"name":"idx_audit_log_payload_method","expressions":["payload ->> ''method''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_method ON public.audit_log USING btree (((payload ->> ''method''::text)));"},{"name":"idx_audit_log_payload_parent","expressions":["payload ->> ''parent''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_parent ON public.audit_log USING btree (((payload ->> ''parent''::text)));"},{"name":"idx_audit_log_payload_resource","expressions":["payload ->> ''resource''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_resource ON public.audit_log USING btree (((payload ->> ''resource''::text)));"},{"name":"idx_audit_log_payload_user","expressions":["payload ->> ''user''::text"],"type":"btree","definition":"CREATE INDEX idx_audit_log_payload_user ON public.audit_log USING btree (((payload ->> ''user''::text)));"}],"rowCount":"81","dataSize":"139264","indexSize":"98304","owner":"bb"},{"name":"changelist","columns":[{"name":"id","position":1,"default":"nextval(''public.changelist_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"updated_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"changelist_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX changelist_pkey ON public.changelist USING btree (id);","isConstraint":true},{"name":"idx_changelist_project_name","expressions":["project","name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_changelist_project_name ON public.changelist USING btree (project, name);"}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"changelist_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"changelist_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"changelog","columns":[{"name":"id","position":1,"default":"nextval(''public.changelog_id_seq''::regclass)","type":"bigint"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"instance","position":3,"type":"text"},{"name":"db_name","position":4,"type":"text"},{"name":"status","position":5,"type":"text"},{"name":"prev_sync_history_id","position":6,"nullable":true,"type":"bigint"},{"name":"sync_history_id","position":7,"nullable":true,"type":"bigint"},{"name":"payload","position":8,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"changelog_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX changelog_pkey ON public.changelog USING btree (id);","isConstraint":true},{"name":"idx_changelog_instance_db_name","expressions":["instance","db_name"],"type":"btree","definition":"CREATE INDEX idx_changelog_instance_db_name ON public.changelog USING btree (instance, db_name);"}],"rowCount":"2","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"changelog_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"changelog_prev_sync_history_id_fkey","columns":["prev_sync_history_id"],"referencedSchema":"public","referencedTable":"sync_history","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"changelog_sync_history_id_fkey","columns":["sync_history_id"],"referencedSchema":"public","referencedTable":"sync_history","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"changelog_status_check","expression":"(status = ANY (ARRAY[''PENDING''::text, ''DONE''::text, ''FAILED''::text]))"}],"owner":"bb"},{"name":"data_source","columns":[{"name":"id","position":1,"default":"nextval(''public.data_source_id_seq''::regclass)","type":"integer"},{"name":"instance","position":2,"type":"text"},{"name":"options","position":3,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"data_source_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX data_source_pkey ON public.data_source USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"8192","foreignKeys":[{"name":"data_source_instance_fkey","columns":["instance"],"referencedSchema":"public","referencedTable":"instance","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"db","columns":[{"name":"id","position":1,"default":"nextval(''public.db_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"project","position":3,"type":"text"},{"name":"instance","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"environment","position":6,"nullable":true,"type":"text"},{"name":"metadata","position":7,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"db_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX db_pkey ON public.db USING btree (id);","isConstraint":true},{"name":"idx_db_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_db_project ON public.db USING btree (project);"},{"name":"idx_db_unique_instance_name","expressions":["instance","name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_unique_instance_name ON public.db USING btree (instance, name);"}],"rowCount":"6","dataSize":"16384","indexSize":"49152","foreignKeys":[{"name":"db_instance_fkey","columns":["instance"],"referencedSchema":"public","referencedTable":"instance","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"db_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"db_group","columns":[{"name":"id","position":1,"default":"nextval(''public.db_group_id_seq''::regclass)","type":"bigint"},{"name":"project","position":2,"type":"text"},{"name":"resource_id","position":3,"type":"text"},{"name":"placeholder","position":4,"default":"''''::text","type":"text"},{"name":"expression","position":5,"default":"''{}''::jsonb","type":"jsonb"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"db_group_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX db_group_pkey ON public.db_group USING btree (id);","isConstraint":true},{"name":"idx_db_group_unique_project_placeholder","expressions":["project","placeholder"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_group_unique_project_placeholder ON public.db_group USING btree (project, placeholder);"},{"name":"idx_db_group_unique_project_resource_id","expressions":["project","resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_group_unique_project_resource_id ON public.db_group USING btree (project, resource_id);"}],"dataSize":"8192","indexSize":"24576","foreignKeys":[{"name":"db_group_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"db_schema","columns":[{"name":"id","position":1,"default":"nextval(''public.db_schema_id_seq''::regclass)","type":"integer"},{"name":"instance","position":2,"type":"text"},{"name":"db_name","position":3,"type":"text"},{"name":"metadata","position":4,"default":"''{}''::json","type":"json"},{"name":"raw_dump","position":5,"default":"''''::text","type":"text"},{"name":"config","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"db_schema_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX db_schema_pkey ON public.db_schema USING btree (id);","isConstraint":true},{"name":"idx_db_schema_unique_instance_db_name","expressions":["instance","db_name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_db_schema_unique_instance_db_name ON public.db_schema USING btree (instance, db_name);"}],"rowCount":"6","dataSize":"73728","indexSize":"32768","foreignKeys":[{"name":"db_schema_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"export_archive","columns":[{"name":"id","position":1,"default":"nextval(''public.export_archive_id_seq''::regclass)","type":"integer"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"bytes","position":3,"nullable":true,"type":"bytea"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"export_archive_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX export_archive_pkey ON public.export_archive USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"8192","owner":"bb"},{"name":"idp","columns":[{"name":"id","position":1,"default":"nextval(''public.idp_id_seq''::regclass)","type":"integer"},{"name":"resource_id","position":2,"type":"text"},{"name":"name","position":3,"type":"text"},{"name":"domain","position":4,"type":"text"},{"name":"type","position":5,"type":"text"},{"name":"config","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idp_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX idp_pkey ON public.idp USING btree (id);","isConstraint":true},{"name":"idx_idp_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_idp_unique_resource_id ON public.idp USING btree (resource_id);"}],"dataSize":"8192","indexSize":"16384","checkConstraints":[{"name":"idp_type_check","expression":"(type = ANY (ARRAY[''OAUTH2''::text, ''OIDC''::text, ''LDAP''::text]))"}],"owner":"bb"},{"name":"instance","columns":[{"name":"id","position":1,"default":"nextval(''public.instance_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"environment","position":3,"nullable":true,"type":"text"},{"name":"resource_id","position":4,"type":"text"},{"name":"metadata","position":5,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_instance_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_instance_unique_resource_id ON public.instance USING btree (resource_id);"},{"name":"instance_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX instance_pkey ON public.instance USING btree (id);","isConstraint":true}],"rowCount":"3","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"instance_change_history","columns":[{"name":"id","position":1,"default":"nextval(''public.instance_change_history_id_seq''::regclass)","type":"bigint"},{"name":"version","position":2,"type":"text"}],"indexes":[{"name":"idx_instance_change_history_unique_version","expressions":["version"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_instance_change_history_unique_version ON public.instance_change_history USING btree (version);"},{"name":"instance_change_history_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX instance_change_history_pkey ON public.instance_change_history USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"issue","columns":[{"name":"id","position":1,"default":"nextval(''public.issue_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":5,"type":"text"},{"name":"plan_id","position":6,"nullable":true,"type":"bigint"},{"name":"pipeline_id","position":7,"nullable":true,"type":"integer"},{"name":"name","position":8,"type":"text"},{"name":"status","position":9,"type":"text"},{"name":"type","position":10,"type":"text"},{"name":"description","position":11,"default":"''''::text","type":"text"},{"name":"payload","position":12,"default":"''{}''::jsonb","type":"jsonb"},{"name":"ts_vector","position":13,"nullable":true,"type":"tsvector"}],"indexes":[{"name":"idx_issue_creator_id","expressions":["creator_id"],"type":"btree","definition":"CREATE INDEX idx_issue_creator_id ON public.issue USING btree (creator_id);"},{"name":"idx_issue_pipeline_id","expressions":["pipeline_id"],"type":"btree","definition":"CREATE INDEX idx_issue_pipeline_id ON public.issue USING btree (pipeline_id);"},{"name":"idx_issue_plan_id","expressions":["plan_id"],"type":"btree","definition":"CREATE INDEX idx_issue_plan_id ON public.issue USING btree (plan_id);"},{"name":"idx_issue_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_issue_project ON public.issue USING btree (project);"},{"name":"idx_issue_ts_vector","expressions":["ts_vector"],"type":"gin","definition":"CREATE INDEX idx_issue_ts_vector ON public.issue USING gin (ts_vector);"},{"name":"issue_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX issue_pkey ON public.issue USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"98304","foreignKeys":[{"name":"issue_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_pipeline_id_fkey","columns":["pipeline_id"],"referencedSchema":"public","referencedTable":"pipeline","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_plan_id_fkey","columns":["plan_id"],"referencedSchema":"public","referencedTable":"plan","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"issue_status_check","expression":"(status = ANY (ARRAY[''OPEN''::text, ''DONE''::text, ''CANCELED''::text]))"}],"owner":"bb"},{"name":"issue_comment","columns":[{"name":"id","position":1,"default":"nextval(''public.issue_comment_id_seq''::regclass)","type":"bigint"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"issue_id","position":5,"type":"integer"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_issue_comment_issue_id","expressions":["issue_id"],"type":"btree","definition":"CREATE INDEX idx_issue_comment_issue_id ON public.issue_comment USING btree (issue_id);"},{"name":"issue_comment_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX issue_comment_pkey ON public.issue_comment USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"issue_comment_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_comment_issue_id_fkey","columns":["issue_id"],"referencedSchema":"public","referencedTable":"issue","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"issue_subscriber","columns":[{"name":"issue_id","position":1,"type":"integer"},{"name":"subscriber_id","position":2,"type":"integer"}],"indexes":[{"name":"idx_issue_subscriber_subscriber_id","expressions":["subscriber_id"],"type":"btree","definition":"CREATE INDEX idx_issue_subscriber_subscriber_id ON public.issue_subscriber USING btree (subscriber_id);"},{"name":"issue_subscriber_pkey","expressions":["issue_id","subscriber_id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX issue_subscriber_pkey ON public.issue_subscriber USING btree (issue_id, subscriber_id);","isConstraint":true}],"indexSize":"16384","foreignKeys":[{"name":"issue_subscriber_issue_id_fkey","columns":["issue_id"],"referencedSchema":"public","referencedTable":"issue","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"issue_subscriber_subscriber_id_fkey","columns":["subscriber_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"pipeline","columns":[{"name":"id","position":1,"default":"nextval(''public.pipeline_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":4,"type":"text"},{"name":"name","position":5,"type":"text"}],"indexes":[{"name":"pipeline_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX pipeline_pkey ON public.pipeline USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","foreignKeys":[{"name":"pipeline_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"pipeline_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"plan","columns":[{"name":"id","position":1,"default":"nextval(''public.plan_id_seq''::regclass)","type":"bigint"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":5,"type":"text"},{"name":"pipeline_id","position":6,"nullable":true,"type":"integer"},{"name":"name","position":7,"type":"text"},{"name":"description","position":8,"type":"text"},{"name":"config","position":9,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_plan_pipeline_id","expressions":["pipeline_id"],"type":"btree","definition":"CREATE INDEX idx_plan_pipeline_id ON public.plan USING btree (pipeline_id);"},{"name":"idx_plan_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_plan_project ON public.plan USING btree (project);"},{"name":"plan_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX plan_pkey ON public.plan USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"49152","foreignKeys":[{"name":"plan_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"plan_pipeline_id_fkey","columns":["pipeline_id"],"referencedSchema":"public","referencedTable":"pipeline","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"plan_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"plan_check_run","columns":[{"name":"id","position":1,"default":"nextval(''public.plan_check_run_id_seq''::regclass)","type":"integer"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"plan_id","position":4,"type":"bigint"},{"name":"status","position":5,"type":"text"},{"name":"type","position":6,"type":"text"},{"name":"config","position":7,"default":"''{}''::jsonb","type":"jsonb"},{"name":"result","position":8,"default":"''{}''::jsonb","type":"jsonb"},{"name":"payload","position":9,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_plan_check_run_plan_id","expressions":["plan_id"],"type":"btree","definition":"CREATE INDEX idx_plan_check_run_plan_id ON public.plan_check_run USING btree (plan_id);"},{"name":"plan_check_run_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX plan_check_run_pkey ON public.plan_check_run USING btree (id);","isConstraint":true}],"rowCount":"6","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"plan_check_run_plan_id_fkey","columns":["plan_id"],"referencedSchema":"public","referencedTable":"plan","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"plan_check_run_status_check","expression":"(status = ANY (ARRAY[''RUNNING''::text, ''DONE''::text, ''FAILED''::text, ''CANCELED''::text]))"},{"name":"plan_check_run_type_check","expression":"(type ~~ ''bb.plan-check.%''::text)"}],"owner":"bb"},{"name":"policy","columns":[{"name":"id","position":1,"default":"nextval(''public.policy_id_seq''::regclass)","type":"integer"},{"name":"enforce","position":2,"default":"true","type":"boolean"},{"name":"updated_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"resource_type","position":4,"type":"text"},{"name":"resource","position":5,"type":"text"},{"name":"type","position":6,"type":"text"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"},{"name":"inherit_from_parent","position":8,"default":"true","type":"boolean"}],"indexes":[{"name":"idx_policy_unique_resource_type_resource_type","expressions":["resource_type","resource","type"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_type ON public.policy USING btree (resource_type, resource, type);"},{"name":"policy_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX policy_pkey ON public.policy USING btree (id);","isConstraint":true}],"rowCount":"8","dataSize":"16384","indexSize":"32768","checkConstraints":[{"name":"policy_resource_type_check","expression":"(resource_type = ANY (ARRAY[''WORKSPACE''::text, ''ENVIRONMENT''::text, ''PROJECT''::text, ''INSTANCE''::text]))"}],"owner":"bb"},{"name":"principal","columns":[{"name":"id","position":1,"default":"nextval(''public.principal_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"type","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"email","position":6,"type":"text"},{"name":"password_hash","position":7,"type":"text"},{"name":"phone","position":8,"default":"''''::text","type":"text"},{"name":"mfa_config","position":9,"default":"''{}''::jsonb","type":"jsonb"},{"name":"profile","position":10,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"principal_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX principal_pkey ON public.principal USING btree (id);","isConstraint":true}],"rowCount":"7","dataSize":"16384","indexSize":"16384","checkConstraints":[{"name":"principal_type_check","expression":"(type = ANY (ARRAY[''END_USER''::text, ''SYSTEM_BOT''::text, ''SERVICE_ACCOUNT''::text]))"}],"owner":"bb"},{"name":"project","columns":[{"name":"id","position":1,"default":"nextval(''public.project_id_seq''::regclass)","type":"integer"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"name","position":3,"type":"text"},{"name":"resource_id","position":4,"type":"text"},{"name":"data_classification_config_id","position":5,"default":"''''::text","type":"text"},{"name":"setting","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_project_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_project_unique_resource_id ON public.project USING btree (resource_id);"},{"name":"project_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX project_pkey ON public.project USING btree (id);","isConstraint":true}],"rowCount":"3","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"project_webhook","columns":[{"name":"id","position":1,"default":"nextval(''public.project_webhook_id_seq''::regclass)","type":"integer"},{"name":"project","position":2,"type":"text"},{"name":"type","position":3,"type":"text"},{"name":"name","position":4,"type":"text"},{"name":"url","position":5,"type":"text"},{"name":"event_list","position":6,"type":"_text"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_project_webhook_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_project_webhook_project ON public.project_webhook USING btree (project);"},{"name":"project_webhook_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX project_webhook_pkey ON public.project_webhook USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"project_webhook_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"project_webhook_type_check","expression":"(type ~~ ''bb.plugin.webhook.%''::text)"}],"owner":"bb"},{"name":"query_history","columns":[{"name":"id","position":1,"default":"nextval(''public.query_history_id_seq''::regclass)","type":"bigint"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project_id","position":4,"type":"text"},{"name":"database","position":5,"type":"text"},{"name":"statement","position":6,"type":"text"},{"name":"type","position":7,"type":"text"},{"name":"payload","position":8,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_query_history_creator_id_created_at_project_id","expressions":["creator_id","created_at","project_id"],"type":"btree","definition":"CREATE INDEX idx_query_history_creator_id_created_at_project_id ON public.query_history USING btree (creator_id, created_at, project_id DESC);"},{"name":"query_history_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX query_history_pkey ON public.query_history USING btree (id);","isConstraint":true}],"rowCount":"5","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"query_history_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"release","columns":[{"name":"id","position":1,"default":"nextval(''public.release_id_seq''::regclass)","type":"bigint"},{"name":"deleted","position":2,"default":"false","type":"boolean"},{"name":"project","position":3,"type":"text"},{"name":"creator_id","position":4,"type":"integer"},{"name":"created_at","position":5,"default":"now()","type":"timestamp with time zone"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_release_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_release_project ON public.release USING btree (project);"},{"name":"release_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX release_pkey ON public.release USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"release_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"release_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"review_config","columns":[{"name":"id","position":1,"type":"text"},{"name":"enabled","position":2,"default":"true","type":"boolean"},{"name":"name","position":3,"type":"text"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"review_config_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX review_config_pkey ON public.review_config USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","owner":"bb"},{"name":"revision","columns":[{"name":"id","position":1,"default":"nextval(''public.revision_id_seq''::regclass)","type":"bigint"},{"name":"instance","position":2,"type":"text"},{"name":"db_name","position":3,"type":"text"},{"name":"created_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"deleter_id","position":5,"nullable":true,"type":"integer"},{"name":"deleted_at","position":6,"nullable":true,"type":"timestamp with time zone"},{"name":"version","position":7,"type":"text"},{"name":"payload","position":8,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_revision_instance_db_name_version","expressions":["instance","db_name","version"],"type":"btree","definition":"CREATE INDEX idx_revision_instance_db_name_version ON public.revision USING btree (instance, db_name, version);"},{"name":"idx_revision_unique_instance_db_name_version_deleted_at_null","expressions":["instance","db_name","version"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_revision_unique_instance_db_name_version_deleted_at_null ON public.revision USING btree (instance, db_name, version) WHERE (deleted_at IS NULL);"},{"name":"revision_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX revision_pkey ON public.revision USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"24576","foreignKeys":[{"name":"revision_deleter_id_fkey","columns":["deleter_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"revision_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"risk","columns":[{"name":"id","position":1,"default":"nextval(''public.risk_id_seq''::regclass)","type":"bigint"},{"name":"source","position":2,"type":"text"},{"name":"level","position":3,"type":"bigint"},{"name":"name","position":4,"type":"text"},{"name":"active","position":5,"type":"boolean"},{"name":"expression","position":6,"type":"jsonb"}],"indexes":[{"name":"risk_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX risk_pkey ON public.risk USING btree (id);","isConstraint":true}],"rowCount":"3","dataSize":"16384","indexSize":"16384","checkConstraints":[{"name":"risk_source_check","expression":"(source ~~ ''bb.risk.%''::text)"}],"owner":"bb"},{"name":"role","columns":[{"name":"id","position":1,"default":"nextval(''public.role_id_seq''::regclass)","type":"bigint"},{"name":"resource_id","position":2,"type":"text"},{"name":"name","position":3,"type":"text"},{"name":"description","position":4,"type":"text"},{"name":"permissions","position":5,"default":"''{}''::jsonb","type":"jsonb"},{"name":"payload","position":6,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_role_unique_resource_id","expressions":["resource_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_role_unique_resource_id ON public.role USING btree (resource_id);"},{"name":"role_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX role_pkey ON public.role USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","owner":"bb"},{"name":"setting","columns":[{"name":"id","position":1,"default":"nextval(''public.setting_id_seq''::regclass)","type":"integer"},{"name":"name","position":2,"type":"text"},{"name":"value","position":3,"type":"text"}],"indexes":[{"name":"idx_setting_unique_name","expressions":["name"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_setting_unique_name ON public.setting USING btree (name);"},{"name":"setting_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX setting_pkey ON public.setting USING btree (id);","isConstraint":true}],"rowCount":"14","dataSize":"49152","indexSize":"32768","owner":"bb"},{"name":"sheet","columns":[{"name":"id","position":1,"default":"nextval(''public.sheet_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":4,"type":"text"},{"name":"name","position":5,"type":"text"},{"name":"sha256","position":6,"type":"bytea"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_sheet_project","expressions":["project"],"type":"btree","definition":"CREATE INDEX idx_sheet_project ON public.sheet USING btree (project);"},{"name":"sheet_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX sheet_pkey ON public.sheet USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"sheet_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"sheet_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"sheet_blob","columns":[{"name":"sha256","position":1,"type":"bytea"},{"name":"content","position":2,"type":"text"}],"indexes":[{"name":"sheet_blob_pkey","expressions":["sha256"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX sheet_blob_pkey ON public.sheet_blob USING btree (sha256);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","owner":"bb"},{"name":"sync_history","columns":[{"name":"id","position":1,"default":"nextval(''public.sync_history_id_seq''::regclass)","type":"bigint"},{"name":"created_at","position":2,"default":"now()","type":"timestamp with time zone"},{"name":"instance","position":3,"type":"text"},{"name":"db_name","position":4,"type":"text"},{"name":"metadata","position":5,"default":"''{}''::json","type":"json"},{"name":"raw_dump","position":6,"default":"''''::text","type":"text"}],"indexes":[{"name":"idx_sync_history_instance_db_name_created_at","expressions":["instance","db_name","created_at"],"type":"btree","definition":"CREATE INDEX idx_sync_history_instance_db_name_created_at ON public.sync_history USING btree (instance, db_name, created_at);"},{"name":"sync_history_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX sync_history_pkey ON public.sync_history USING btree (id);","isConstraint":true}],"rowCount":"2","dataSize":"32768","indexSize":"32768","foreignKeys":[{"name":"sync_history_instance_db_name_fkey","columns":["instance","db_name"],"referencedSchema":"public","referencedTable":"db","referencedColumns":["instance","name"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"task","columns":[{"name":"id","position":1,"default":"nextval(''public.task_id_seq''::regclass)","type":"integer"},{"name":"pipeline_id","position":2,"type":"integer"},{"name":"instance","position":4,"type":"text"},{"name":"db_name","position":5,"nullable":true,"type":"text"},{"name":"type","position":6,"type":"text"},{"name":"payload","position":7,"default":"''{}''::jsonb","type":"jsonb"},{"name":"environment","position":9,"nullable":true,"type":"text"}],"indexes":[{"name":"idx_task_pipeline_id_environment","expressions":["pipeline_id","environment"],"type":"btree","definition":"CREATE INDEX idx_task_pipeline_id_environment ON public.task USING btree (pipeline_id, environment);"},{"name":"task_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX task_pkey ON public.task USING btree (id);","isConstraint":true}],"rowCount":"2","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"task_instance_fkey","columns":["instance"],"referencedSchema":"public","referencedTable":"instance","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"task_pipeline_id_fkey","columns":["pipeline_id"],"referencedSchema":"public","referencedTable":"pipeline","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"task_run","columns":[{"name":"id","position":1,"default":"nextval(''public.task_run_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"task_id","position":5,"type":"integer"},{"name":"sheet_id","position":6,"nullable":true,"type":"integer"},{"name":"attempt","position":7,"type":"integer"},{"name":"status","position":8,"type":"text"},{"name":"started_at","position":9,"nullable":true,"type":"timestamp with time zone"},{"name":"code","position":10,"default":"0","type":"integer"},{"name":"result","position":11,"default":"''{}''::jsonb","type":"jsonb"},{"name":"run_at","position":12,"nullable":true,"type":"timestamp with time zone"}],"indexes":[{"name":"idx_task_run_task_id","expressions":["task_id"],"type":"btree","definition":"CREATE INDEX idx_task_run_task_id ON public.task_run USING btree (task_id);"},{"name":"task_run_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX task_run_pkey ON public.task_run USING btree (id);","isConstraint":true},{"name":"uk_task_run_task_id_attempt","expressions":["task_id","attempt"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX uk_task_run_task_id_attempt ON public.task_run USING btree (task_id, attempt);"}],"dataSize":"8192","indexSize":"24576","foreignKeys":[{"name":"task_run_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"task_run_sheet_id_fkey","columns":["sheet_id"],"referencedSchema":"public","referencedTable":"sheet","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"task_run_task_id_fkey","columns":["task_id"],"referencedSchema":"public","referencedTable":"task","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"checkConstraints":[{"name":"task_run_status_check","expression":"(status = ANY (ARRAY[''PENDING''::text, ''RUNNING''::text, ''DONE''::text, ''FAILED''::text, ''CANCELED''::text]))"}],"owner":"bb"},{"name":"task_run_log","columns":[{"name":"id","position":1,"default":"nextval(''public.task_run_log_id_seq''::regclass)","type":"bigint"},{"name":"task_run_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_task_run_log_task_run_id","expressions":["task_run_id"],"type":"btree","definition":"CREATE INDEX idx_task_run_log_task_run_id ON public.task_run_log USING btree (task_run_id);"},{"name":"task_run_log_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX task_run_log_pkey ON public.task_run_log USING btree (id);","isConstraint":true}],"dataSize":"8192","indexSize":"16384","foreignKeys":[{"name":"task_run_log_task_run_id_fkey","columns":["task_run_id"],"referencedSchema":"public","referencedTable":"task_run","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"user_group","columns":[{"name":"email","position":1,"type":"text"},{"name":"name","position":2,"type":"text"},{"name":"description","position":3,"default":"''''::text","type":"text"},{"name":"payload","position":4,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"user_group_pkey","expressions":["email"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX user_group_pkey ON public.user_group USING btree (email);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"16384","owner":"bb"},{"name":"worksheet","columns":[{"name":"id","position":1,"default":"nextval(''public.worksheet_id_seq''::regclass)","type":"integer"},{"name":"creator_id","position":2,"type":"integer"},{"name":"created_at","position":3,"default":"now()","type":"timestamp with time zone"},{"name":"updated_at","position":4,"default":"now()","type":"timestamp with time zone"},{"name":"project","position":5,"type":"text"},{"name":"instance","position":6,"nullable":true,"type":"text"},{"name":"db_name","position":7,"nullable":true,"type":"text"},{"name":"name","position":8,"type":"text"},{"name":"statement","position":9,"type":"text"},{"name":"visibility","position":10,"type":"text"},{"name":"payload","position":11,"default":"''{}''::jsonb","type":"jsonb"}],"indexes":[{"name":"idx_worksheet_creator_id_project","expressions":["creator_id","project"],"type":"btree","definition":"CREATE INDEX idx_worksheet_creator_id_project ON public.worksheet USING btree (creator_id, project);"},{"name":"worksheet_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX worksheet_pkey ON public.worksheet USING btree (id);","isConstraint":true}],"rowCount":"1","dataSize":"16384","indexSize":"32768","foreignKeys":[{"name":"worksheet_creator_id_fkey","columns":["creator_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"worksheet_project_fkey","columns":["project"],"referencedSchema":"public","referencedTable":"project","referencedColumns":["resource_id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"},{"name":"worksheet_organizer","columns":[{"name":"id","position":1,"default":"nextval(''public.worksheet_organizer_id_seq''::regclass)","type":"integer"},{"name":"worksheet_id","position":2,"type":"integer"},{"name":"principal_id","position":3,"type":"integer"},{"name":"starred","position":4,"default":"false","type":"boolean"}],"indexes":[{"name":"idx_worksheet_organizer_principal_id","expressions":["principal_id"],"type":"btree","definition":"CREATE INDEX idx_worksheet_organizer_principal_id ON public.worksheet_organizer USING btree (principal_id);"},{"name":"idx_worksheet_organizer_unique_sheet_id_principal_id","expressions":["worksheet_id","principal_id"],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX idx_worksheet_organizer_unique_sheet_id_principal_id ON public.worksheet_organizer USING btree (worksheet_id, principal_id);"},{"name":"worksheet_organizer_pkey","expressions":["id"],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX worksheet_organizer_pkey ON public.worksheet_organizer USING btree (id);","isConstraint":true}],"indexSize":"24576","foreignKeys":[{"name":"worksheet_organizer_principal_id_fkey","columns":["principal_id"],"referencedSchema":"public","referencedTable":"principal","referencedColumns":["id"],"onDelete":"NO ACTION","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"worksheet_organizer_worksheet_id_fkey","columns":["worksheet_id"],"referencedSchema":"public","referencedTable":"worksheet","referencedColumns":["id"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bb"}],"sequences":[{"name":"audit_log_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"181","ownerTable":"audit_log","ownerColumn":"id"},{"name":"changelist_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"changelist","ownerColumn":"id"},{"name":"changelog_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"changelog","ownerColumn":"id"},{"name":"data_source_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"data_source","ownerColumn":"id"},{"name":"db_group_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"db_group","ownerColumn":"id"},{"name":"db_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"106","ownerTable":"db","ownerColumn":"id"},{"name":"db_schema_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"108","ownerTable":"db_schema","ownerColumn":"id"},{"name":"export_archive_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"export_archive","ownerColumn":"id"},{"name":"idp_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"idp","ownerColumn":"id"},{"name":"instance_change_history_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"123","ownerTable":"instance_change_history","ownerColumn":"id"},{"name":"instance_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"103","ownerTable":"instance","ownerColumn":"id"},{"name":"issue_comment_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"issue_comment","ownerColumn":"id"},{"name":"issue_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"issue","ownerColumn":"id"},{"name":"pipeline_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"pipeline","ownerColumn":"id"},{"name":"plan_check_run_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"106","ownerTable":"plan_check_run","ownerColumn":"id"},{"name":"plan_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"plan","ownerColumn":"id"},{"name":"policy_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"111","ownerTable":"policy","ownerColumn":"id"},{"name":"principal_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"106","ownerTable":"principal","ownerColumn":"id"},{"name":"project_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"project","ownerColumn":"id"},{"name":"project_webhook_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"project_webhook","ownerColumn":"id"},{"name":"query_history_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"105","ownerTable":"query_history","ownerColumn":"id"},{"name":"release_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"release","ownerColumn":"id"},{"name":"revision_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"revision","ownerColumn":"id"},{"name":"risk_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"103","ownerTable":"risk","ownerColumn":"id"},{"name":"role_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"role","ownerColumn":"id"},{"name":"setting_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"139","ownerTable":"setting","ownerColumn":"id"},{"name":"sheet_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"sheet","ownerColumn":"id"},{"name":"sync_history_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"sync_history","ownerColumn":"id"},{"name":"task_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"102","ownerTable":"task","ownerColumn":"id"},{"name":"task_run_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"task_run","ownerColumn":"id"},{"name":"task_run_log_id_seq","dataType":"bigint","start":"1","minValue":"1","maxValue":"9223372036854775807","increment":"1","cacheSize":"1","ownerTable":"task_run_log","ownerColumn":"id"},{"name":"worksheet_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","lastValue":"101","ownerTable":"worksheet","ownerColumn":"id"},{"name":"worksheet_organizer_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"worksheet_organizer","ownerColumn":"id"}],"owner":"pg_database_owner"}],"characterSet":"UTF8","collation":"en_US.UTF-8","owner":"bb","searchPath":"\"$user\", public"}', 'SET statement_timeout = 0;SET lock_timeout = 0;SET idle_in_transaction_session_timeout = 0;@@ -2493,7 +2188,7 @@ ALTER TABLE "public"."worksheet_organizer"REFERENCES "public"."worksheet" ("id");', '{}') ON CONFLICT DO NOTHING;-INSERT INTO public.db_schema (id, instance, db_name, metadata, raw_dump, config) VALUES (101, 'bytebase-meta', 'postgres', '{"name":"postgres", "schemas":[{"name":"public", "owner":"pg_database_owner"}], "characterSet":"UTF8", "collation":"en_US.UTF-8", "owner":"bb", "searchPath":"\"$user\", public"}', '+INSERT INTO public.db_schema (instance, db_name, metadata, raw_dump, config) VALUES ('bytebase-meta', 'postgres', '{"name":"postgres", "schemas":[{"name":"public", "owner":"pg_database_owner"}], "characterSet":"UTF8", "collation":"en_US.UTF-8", "owner":"bb", "searchPath":"\"$user\", public"}', 'SET statement_timeout = 0;SET lock_timeout = 0;SET idle_in_transaction_session_timeout = 0;@@ -2508,7 +2203,7 @@ SET row_security = off;SET default_tablespace = '''';', '{}') ON CONFLICT DO NOTHING;-INSERT INTO public.db_schema (id, instance, db_name, metadata, raw_dump, config) VALUES (105, 'prod-sample-instance', 'postgres', '{"name":"postgres", "schemas":[{"name":"public", "owner":"pg_database_owner"}], "characterSet":"UTF8", "collation":"en_US.UTF-8", "owner":"bbsample", "searchPath":"\"$user\", public"}', '+INSERT INTO public.db_schema (instance, db_name, metadata, raw_dump, config) VALUES ('prod-sample-instance', 'postgres', '{"name":"postgres", "schemas":[{"name":"public", "owner":"pg_database_owner"}], "characterSet":"UTF8", "collation":"en_US.UTF-8", "owner":"bbsample", "searchPath":"\"$user\", public"}', 'SET statement_timeout = 0;SET lock_timeout = 0;SET idle_in_transaction_session_timeout = 0;@@ -2523,7 +2218,7 @@ SET row_security = off;SET default_tablespace = '''';', '{}') ON CONFLICT DO NOTHING;-INSERT INTO public.db_schema (id, instance, db_name, metadata, raw_dump, config) VALUES (103, 'test-sample-instance', 'postgres', '{"name":"postgres", "schemas":[{"name":"public", "owner":"pg_database_owner"}], "characterSet":"UTF8", "collation":"en_US.UTF-8", "owner":"bbsample", "searchPath":"\"$user\", public"}', '+INSERT INTO public.db_schema (instance, db_name, metadata, raw_dump, config) VALUES ('test-sample-instance', 'postgres', '{"name":"postgres", "schemas":[{"name":"public", "owner":"pg_database_owner"}], "characterSet":"UTF8", "collation":"en_US.UTF-8", "owner":"bbsample", "searchPath":"\"$user\", public"}', 'SET statement_timeout = 0;SET lock_timeout = 0;SET idle_in_transaction_session_timeout = 0;@@ -2538,7 +2233,7 @@ SET row_security = off;SET default_tablespace = '''';', '{}') ON CONFLICT DO NOTHING;-INSERT INTO public.db_schema (id, instance, db_name, metadata, raw_dump, config) VALUES (106, 'prod-sample-instance', 'hr_prod', '{"name":"hr_prod","schemas":[{"name":"bbdataarchive","owner":"bbsample"},{"name":"public","tables":[{"name":"audit","columns":[{"name":"id","position":1,"default":"nextval(''public.audit_id_seq''::regclass)","type":"integer"},{"name":"operation","position":2,"type":"text"},{"name":"query","position":3,"nullable":true,"type":"text"},{"name":"user_name","position":4,"type":"text"},{"name":"changed_at","position":5,"default":"CURRENT_TIMESTAMP","nullable":true,"type":"timestamp(6) with time zone"}],"indexes":[{"name":"audit_pkey","expressions":["id"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX audit_pkey ON public.audit USING btree (id);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_audit_changed_at","expressions":["changed_at"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_changed_at ON public.audit USING btree (changed_at);","opclassNames":["timestamptz_ops"],"opclassDefaults":[true]},{"name":"idx_audit_operation","expressions":["operation"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_operation ON public.audit USING btree (operation);","opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"idx_audit_username","expressions":["user_name"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_username ON public.audit USING btree (user_name);","opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"8192","indexSize":"32768","owner":"bbsample"},{"name":"department","columns":[{"name":"dept_no","position":1,"type":"text"},{"name":"dept_name","position":2,"type":"text"}],"indexes":[{"name":"department_dept_name_key","expressions":["dept_name"],"descending":[false],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX department_dept_name_key ON public.department USING btree (dept_name);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"department_pkey","expressions":["dept_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX department_pkey ON public.department USING btree (dept_no);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"16384","indexSize":"32768","owner":"bbsample"},{"name":"dept_emp","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_emp_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_emp_pkey ON public.dept_emp USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"rowCount":"1103","dataSize":"106496","indexSize":"57344","foreignKeys":[{"name":"dept_emp_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_emp_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"dept_manager","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_manager_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_manager_pkey ON public.dept_manager USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"dataSize":"16384","indexSize":"16384","foreignKeys":[{"name":"dept_manager_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_manager_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"employee","columns":[{"name":"emp_no","position":1,"default":"nextval(''public.employee_emp_no_seq''::regclass)","type":"integer"},{"name":"birth_date","position":2,"type":"date"},{"name":"first_name","position":3,"type":"text"},{"name":"last_name","position":4,"type":"text"},{"name":"gender","position":5,"type":"text"},{"name":"hire_date","position":6,"type":"date"}],"indexes":[{"name":"employee_pkey","expressions":["emp_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX employee_pkey ON public.employee USING btree (emp_no);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_employee_hire_date","expressions":["hire_date"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_employee_hire_date ON public.employee USING btree (hire_date);","opclassNames":["date_ops"],"opclassDefaults":[true]}],"rowCount":"1000","dataSize":"98304","indexSize":"98304","checkConstraints":[{"name":"employee_gender_check","expression":"(gender = ANY (ARRAY[''M''::text, ''F''::text]))"}],"owner":"bbsample"},{"name":"salary","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"amount","position":2,"type":"integer"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"idx_salary_amount","expressions":["amount"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_salary_amount ON public.salary USING btree (amount);","opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"salary_pkey","expressions":["emp_no","from_date"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX salary_pkey ON public.salary USING btree (emp_no, from_date);","isConstraint":true,"opclassNames":["int4_ops","date_ops"],"opclassDefaults":[true,true]}],"rowCount":"9488","dataSize":"458752","indexSize":"548864","foreignKeys":[{"name":"salary_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample","triggers":[{"name":"salary_log_trigger","body":"CREATE TRIGGER salary_log_trigger AFTER DELETE OR UPDATE ON public.salary FOR EACH ROW EXECUTE FUNCTION public.log_dml_operations()"}]},{"name":"title","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"title","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}],"indexes":[{"name":"title_pkey","expressions":["emp_no","title","from_date"],"descending":[false,false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX title_pkey ON public.title USING btree (emp_no, title, from_date);","isConstraint":true,"opclassNames":["int4_ops","text_ops","date_ops"],"opclassDefaults":[true,true,true]}],"rowCount":"1470","dataSize":"131072","indexSize":"73728","foreignKeys":[{"name":"title_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"}],"views":[{"name":"current_dept_emp","definition":" SELECT l.emp_no,\n d.dept_no,\n l.from_date,\n l.to_date\n FROM (public.dept_emp d\n JOIN public.dept_emp_latest_date l ON (((d.emp_no = l.emp_no) AND (d.from_date = l.from_date) AND (l.to_date = d.to_date))));","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"dept_no"},{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"},{"schema":"public","table":"dept_emp_latest_date","column":"emp_no"},{"schema":"public","table":"dept_emp_latest_date","column":"from_date"},{"schema":"public","table":"dept_emp_latest_date","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"dept_no","position":2,"nullable":true,"type":"text"},{"name":"from_date","position":3,"nullable":true,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}]},{"name":"dept_emp_latest_date","definition":" SELECT emp_no,\n max(from_date) AS from_date,\n max(to_date) AS to_date\n FROM public.dept_emp\n GROUP BY emp_no;","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"from_date","position":2,"nullable":true,"type":"date"},{"name":"to_date","position":3,"nullable":true,"type":"date"}]}],"functions":[{"name":"log_dml_operations","definition":"CREATE OR REPLACE FUNCTION public.log_dml_operations()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF (TG_OP = ''INSERT'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''INSERT'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''UPDATE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''UPDATE'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''DELETE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''DELETE'', current_query(), current_user);\n RETURN OLD;\n END IF;\n RETURN NULL;\nEND;\n$function$\n","signature":"log_dml_operations()"}],"sequences":[{"name":"audit_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"audit","ownerColumn":"id"},{"name":"employee_emp_no_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"employee","ownerColumn":"emp_no"}],"owner":"pg_database_owner","comment":"standard public schema"}],"characterSet":"UTF8","collation":"en_US.UTF-8","owner":"bbsample","searchPath":"\"$user\", public"}', '+INSERT INTO public.db_schema (instance, db_name, metadata, raw_dump, config) VALUES ('prod-sample-instance', 'hr_prod', '{"name":"hr_prod","schemas":[{"name":"bbdataarchive","owner":"bbsample"},{"name":"public","tables":[{"name":"audit","columns":[{"name":"id","position":1,"default":"nextval(''public.audit_id_seq''::regclass)","type":"integer"},{"name":"operation","position":2,"type":"text"},{"name":"query","position":3,"nullable":true,"type":"text"},{"name":"user_name","position":4,"type":"text"},{"name":"changed_at","position":5,"default":"CURRENT_TIMESTAMP","nullable":true,"type":"timestamp(6) with time zone"}],"indexes":[{"name":"audit_pkey","expressions":["id"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX audit_pkey ON public.audit USING btree (id);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_audit_changed_at","expressions":["changed_at"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_changed_at ON public.audit USING btree (changed_at);","opclassNames":["timestamptz_ops"],"opclassDefaults":[true]},{"name":"idx_audit_operation","expressions":["operation"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_operation ON public.audit USING btree (operation);","opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"idx_audit_username","expressions":["user_name"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_username ON public.audit USING btree (user_name);","opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"8192","indexSize":"32768","owner":"bbsample"},{"name":"department","columns":[{"name":"dept_no","position":1,"type":"text"},{"name":"dept_name","position":2,"type":"text"}],"indexes":[{"name":"department_dept_name_key","expressions":["dept_name"],"descending":[false],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX department_dept_name_key ON public.department USING btree (dept_name);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"department_pkey","expressions":["dept_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX department_pkey ON public.department USING btree (dept_no);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"16384","indexSize":"32768","owner":"bbsample"},{"name":"dept_emp","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_emp_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_emp_pkey ON public.dept_emp USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"rowCount":"1103","dataSize":"106496","indexSize":"57344","foreignKeys":[{"name":"dept_emp_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_emp_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"dept_manager","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_manager_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_manager_pkey ON public.dept_manager USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"dataSize":"16384","indexSize":"16384","foreignKeys":[{"name":"dept_manager_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_manager_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"employee","columns":[{"name":"emp_no","position":1,"default":"nextval(''public.employee_emp_no_seq''::regclass)","type":"integer"},{"name":"birth_date","position":2,"type":"date"},{"name":"first_name","position":3,"type":"text"},{"name":"last_name","position":4,"type":"text"},{"name":"gender","position":5,"type":"text"},{"name":"hire_date","position":6,"type":"date"}],"indexes":[{"name":"employee_pkey","expressions":["emp_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX employee_pkey ON public.employee USING btree (emp_no);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_employee_hire_date","expressions":["hire_date"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_employee_hire_date ON public.employee USING btree (hire_date);","opclassNames":["date_ops"],"opclassDefaults":[true]}],"rowCount":"1000","dataSize":"98304","indexSize":"98304","checkConstraints":[{"name":"employee_gender_check","expression":"(gender = ANY (ARRAY[''M''::text, ''F''::text]))"}],"owner":"bbsample"},{"name":"salary","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"amount","position":2,"type":"integer"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"idx_salary_amount","expressions":["amount"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_salary_amount ON public.salary USING btree (amount);","opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"salary_pkey","expressions":["emp_no","from_date"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX salary_pkey ON public.salary USING btree (emp_no, from_date);","isConstraint":true,"opclassNames":["int4_ops","date_ops"],"opclassDefaults":[true,true]}],"rowCount":"9488","dataSize":"458752","indexSize":"548864","foreignKeys":[{"name":"salary_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample","triggers":[{"name":"salary_log_trigger","body":"CREATE TRIGGER salary_log_trigger AFTER DELETE OR UPDATE ON public.salary FOR EACH ROW EXECUTE FUNCTION public.log_dml_operations()"}]},{"name":"title","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"title","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}],"indexes":[{"name":"title_pkey","expressions":["emp_no","title","from_date"],"descending":[false,false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX title_pkey ON public.title USING btree (emp_no, title, from_date);","isConstraint":true,"opclassNames":["int4_ops","text_ops","date_ops"],"opclassDefaults":[true,true,true]}],"rowCount":"1470","dataSize":"131072","indexSize":"73728","foreignKeys":[{"name":"title_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"}],"views":[{"name":"current_dept_emp","definition":" SELECT l.emp_no,\n d.dept_no,\n l.from_date,\n l.to_date\n FROM (public.dept_emp d\n JOIN public.dept_emp_latest_date l ON (((d.emp_no = l.emp_no) AND (d.from_date = l.from_date) AND (l.to_date = d.to_date))));","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"dept_no"},{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"},{"schema":"public","table":"dept_emp_latest_date","column":"emp_no"},{"schema":"public","table":"dept_emp_latest_date","column":"from_date"},{"schema":"public","table":"dept_emp_latest_date","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"dept_no","position":2,"nullable":true,"type":"text"},{"name":"from_date","position":3,"nullable":true,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}]},{"name":"dept_emp_latest_date","definition":" SELECT emp_no,\n max(from_date) AS from_date,\n max(to_date) AS to_date\n FROM public.dept_emp\n GROUP BY emp_no;","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"from_date","position":2,"nullable":true,"type":"date"},{"name":"to_date","position":3,"nullable":true,"type":"date"}]}],"functions":[{"name":"log_dml_operations","definition":"CREATE OR REPLACE FUNCTION public.log_dml_operations()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF (TG_OP = ''INSERT'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''INSERT'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''UPDATE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''UPDATE'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''DELETE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''DELETE'', current_query(), current_user);\n RETURN OLD;\n END IF;\n RETURN NULL;\nEND;\n$function$\n","signature":"log_dml_operations()"}],"sequences":[{"name":"audit_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"audit","ownerColumn":"id"},{"name":"employee_emp_no_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"employee","ownerColumn":"emp_no"}],"owner":"pg_database_owner","comment":"standard public schema"}],"characterSet":"UTF8","collation":"en_US.UTF-8","owner":"bbsample","searchPath":"\"$user\", public"}', 'SET statement_timeout = 0;SET lock_timeout = 0;SET idle_in_transaction_session_timeout = 0;@@ -2720,7 +2415,7 @@ ALTER TABLE "public"."title"ON DELETE CASCADE;', '{"schemas": [{"name": "public", "tables": [{"name": "salary", "columns": [{"name": "to_date"}, {"name": "amount", "semanticType": "bb.default"}, {"name": "emp_no"}, {"name": "from_date"}]}, {"name": "employee", "columns": [{"name": "last_name", "classification": "1-2"}, {"name": "emp_no"}, {"name": "birth_date"}, {"name": "gender"}, {"name": "hire_date"}, {"name": "first_name", "classification": "1-2"}]}]}]}') ON CONFLICT DO NOTHING;-INSERT INTO public.db_schema (id, instance, db_name, metadata, raw_dump, config) VALUES (104, 'test-sample-instance', 'hr_test', '{"name":"hr_test","schemas":[{"name":"bbdataarchive","owner":"bbsample"},{"name":"public","tables":[{"name":"audit","columns":[{"name":"id","position":1,"default":"nextval(''public.audit_id_seq''::regclass)","type":"integer"},{"name":"operation","position":2,"type":"text"},{"name":"query","position":3,"nullable":true,"type":"text"},{"name":"user_name","position":4,"type":"text"},{"name":"changed_at","position":5,"default":"CURRENT_TIMESTAMP","nullable":true,"type":"timestamp(6) with time zone"}],"indexes":[{"name":"audit_pkey","expressions":["id"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX audit_pkey ON public.audit USING btree (id);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_audit_changed_at","expressions":["changed_at"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_changed_at ON public.audit USING btree (changed_at);","opclassNames":["timestamptz_ops"],"opclassDefaults":[true]},{"name":"idx_audit_operation","expressions":["operation"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_operation ON public.audit USING btree (operation);","opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"idx_audit_username","expressions":["user_name"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_username ON public.audit USING btree (user_name);","opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"8192","indexSize":"32768","owner":"bbsample"},{"name":"department","columns":[{"name":"dept_no","position":1,"type":"text"},{"name":"dept_name","position":2,"type":"text"}],"indexes":[{"name":"department_dept_name_key","expressions":["dept_name"],"descending":[false],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX department_dept_name_key ON public.department USING btree (dept_name);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"department_pkey","expressions":["dept_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX department_pkey ON public.department USING btree (dept_no);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"16384","indexSize":"32768","owner":"bbsample"},{"name":"dept_emp","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_emp_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_emp_pkey ON public.dept_emp USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"rowCount":"1103","dataSize":"106496","indexSize":"57344","foreignKeys":[{"name":"dept_emp_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_emp_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"dept_manager","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_manager_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_manager_pkey ON public.dept_manager USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"dataSize":"16384","indexSize":"16384","foreignKeys":[{"name":"dept_manager_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_manager_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"employee","columns":[{"name":"emp_no","position":1,"default":"nextval(''public.employee_emp_no_seq''::regclass)","type":"integer"},{"name":"birth_date","position":2,"type":"date"},{"name":"first_name","position":3,"type":"text"},{"name":"last_name","position":4,"type":"text"},{"name":"gender","position":5,"type":"text"},{"name":"hire_date","position":6,"type":"date"}],"indexes":[{"name":"employee_pkey","expressions":["emp_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX employee_pkey ON public.employee USING btree (emp_no);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_employee_hire_date","expressions":["hire_date"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_employee_hire_date ON public.employee USING btree (hire_date);","opclassNames":["date_ops"],"opclassDefaults":[true]}],"rowCount":"1000","dataSize":"98304","indexSize":"98304","checkConstraints":[{"name":"employee_gender_check","expression":"(gender = ANY (ARRAY[''M''::text, ''F''::text]))"}],"owner":"bbsample"},{"name":"salary","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"amount","position":2,"type":"integer"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"idx_salary_amount","expressions":["amount"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_salary_amount ON public.salary USING btree (amount);","opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"salary_pkey","expressions":["emp_no","from_date"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX salary_pkey ON public.salary USING btree (emp_no, from_date);","isConstraint":true,"opclassNames":["int4_ops","date_ops"],"opclassDefaults":[true,true]}],"rowCount":"9488","dataSize":"458752","indexSize":"548864","foreignKeys":[{"name":"salary_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample","triggers":[{"name":"salary_log_trigger","body":"CREATE TRIGGER salary_log_trigger AFTER DELETE OR UPDATE ON public.salary FOR EACH ROW EXECUTE FUNCTION public.log_dml_operations()"}]},{"name":"title","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"title","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}],"indexes":[{"name":"title_pkey","expressions":["emp_no","title","from_date"],"descending":[false,false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX title_pkey ON public.title USING btree (emp_no, title, from_date);","isConstraint":true,"opclassNames":["int4_ops","text_ops","date_ops"],"opclassDefaults":[true,true,true]}],"rowCount":"1470","dataSize":"131072","indexSize":"73728","foreignKeys":[{"name":"title_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"}],"views":[{"name":"current_dept_emp","definition":" SELECT l.emp_no,\n d.dept_no,\n l.from_date,\n l.to_date\n FROM (public.dept_emp d\n JOIN public.dept_emp_latest_date l ON (((d.emp_no = l.emp_no) AND (d.from_date = l.from_date) AND (l.to_date = d.to_date))));","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"dept_no"},{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"},{"schema":"public","table":"dept_emp_latest_date","column":"emp_no"},{"schema":"public","table":"dept_emp_latest_date","column":"from_date"},{"schema":"public","table":"dept_emp_latest_date","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"dept_no","position":2,"nullable":true,"type":"text"},{"name":"from_date","position":3,"nullable":true,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}]},{"name":"dept_emp_latest_date","definition":" SELECT emp_no,\n max(from_date) AS from_date,\n max(to_date) AS to_date\n FROM public.dept_emp\n GROUP BY emp_no;","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"from_date","position":2,"nullable":true,"type":"date"},{"name":"to_date","position":3,"nullable":true,"type":"date"}]}],"functions":[{"name":"log_dml_operations","definition":"CREATE OR REPLACE FUNCTION public.log_dml_operations()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF (TG_OP = ''INSERT'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''INSERT'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''UPDATE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''UPDATE'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''DELETE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''DELETE'', current_query(), current_user);\n RETURN OLD;\n END IF;\n RETURN NULL;\nEND;\n$function$\n","signature":"log_dml_operations()"}],"sequences":[{"name":"audit_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"audit","ownerColumn":"id"},{"name":"employee_emp_no_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"employee","ownerColumn":"emp_no"}],"owner":"pg_database_owner","comment":"standard public schema"}],"characterSet":"UTF8","collation":"en_US.UTF-8","owner":"bbsample","searchPath":"\"$user\", public"}', '+INSERT INTO public.db_schema (instance, db_name, metadata, raw_dump, config) VALUES ('test-sample-instance', 'hr_test', '{"name":"hr_test","schemas":[{"name":"bbdataarchive","owner":"bbsample"},{"name":"public","tables":[{"name":"audit","columns":[{"name":"id","position":1,"default":"nextval(''public.audit_id_seq''::regclass)","type":"integer"},{"name":"operation","position":2,"type":"text"},{"name":"query","position":3,"nullable":true,"type":"text"},{"name":"user_name","position":4,"type":"text"},{"name":"changed_at","position":5,"default":"CURRENT_TIMESTAMP","nullable":true,"type":"timestamp(6) with time zone"}],"indexes":[{"name":"audit_pkey","expressions":["id"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX audit_pkey ON public.audit USING btree (id);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_audit_changed_at","expressions":["changed_at"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_changed_at ON public.audit USING btree (changed_at);","opclassNames":["timestamptz_ops"],"opclassDefaults":[true]},{"name":"idx_audit_operation","expressions":["operation"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_operation ON public.audit USING btree (operation);","opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"idx_audit_username","expressions":["user_name"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_audit_username ON public.audit USING btree (user_name);","opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"8192","indexSize":"32768","owner":"bbsample"},{"name":"department","columns":[{"name":"dept_no","position":1,"type":"text"},{"name":"dept_name","position":2,"type":"text"}],"indexes":[{"name":"department_dept_name_key","expressions":["dept_name"],"descending":[false],"type":"btree","unique":true,"definition":"CREATE UNIQUE INDEX department_dept_name_key ON public.department USING btree (dept_name);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]},{"name":"department_pkey","expressions":["dept_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX department_pkey ON public.department USING btree (dept_no);","isConstraint":true,"opclassNames":["text_ops"],"opclassDefaults":[true]}],"dataSize":"16384","indexSize":"32768","owner":"bbsample"},{"name":"dept_emp","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_emp_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_emp_pkey ON public.dept_emp USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"rowCount":"1103","dataSize":"106496","indexSize":"57344","foreignKeys":[{"name":"dept_emp_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_emp_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"dept_manager","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"dept_no","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"dept_manager_pkey","expressions":["emp_no","dept_no"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX dept_manager_pkey ON public.dept_manager USING btree (emp_no, dept_no);","isConstraint":true,"opclassNames":["int4_ops","text_ops"],"opclassDefaults":[true,true]}],"dataSize":"16384","indexSize":"16384","foreignKeys":[{"name":"dept_manager_dept_no_fkey","columns":["dept_no"],"referencedSchema":"public","referencedTable":"department","referencedColumns":["dept_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"},{"name":"dept_manager_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"},{"name":"employee","columns":[{"name":"emp_no","position":1,"default":"nextval(''public.employee_emp_no_seq''::regclass)","type":"integer"},{"name":"birth_date","position":2,"type":"date"},{"name":"first_name","position":3,"type":"text"},{"name":"last_name","position":4,"type":"text"},{"name":"gender","position":5,"type":"text"},{"name":"hire_date","position":6,"type":"date"}],"indexes":[{"name":"employee_pkey","expressions":["emp_no"],"descending":[false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX employee_pkey ON public.employee USING btree (emp_no);","isConstraint":true,"opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"idx_employee_hire_date","expressions":["hire_date"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_employee_hire_date ON public.employee USING btree (hire_date);","opclassNames":["date_ops"],"opclassDefaults":[true]}],"rowCount":"1000","dataSize":"98304","indexSize":"98304","checkConstraints":[{"name":"employee_gender_check","expression":"(gender = ANY (ARRAY[''M''::text, ''F''::text]))"}],"owner":"bbsample"},{"name":"salary","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"amount","position":2,"type":"integer"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"type":"date"}],"indexes":[{"name":"idx_salary_amount","expressions":["amount"],"descending":[false],"type":"btree","definition":"CREATE INDEX idx_salary_amount ON public.salary USING btree (amount);","opclassNames":["int4_ops"],"opclassDefaults":[true]},{"name":"salary_pkey","expressions":["emp_no","from_date"],"descending":[false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX salary_pkey ON public.salary USING btree (emp_no, from_date);","isConstraint":true,"opclassNames":["int4_ops","date_ops"],"opclassDefaults":[true,true]}],"rowCount":"9488","dataSize":"458752","indexSize":"548864","foreignKeys":[{"name":"salary_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample","triggers":[{"name":"salary_log_trigger","body":"CREATE TRIGGER salary_log_trigger AFTER DELETE OR UPDATE ON public.salary FOR EACH ROW EXECUTE FUNCTION public.log_dml_operations()"}]},{"name":"title","columns":[{"name":"emp_no","position":1,"type":"integer"},{"name":"title","position":2,"type":"text"},{"name":"from_date","position":3,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}],"indexes":[{"name":"title_pkey","expressions":["emp_no","title","from_date"],"descending":[false,false,false],"type":"btree","unique":true,"primary":true,"definition":"CREATE UNIQUE INDEX title_pkey ON public.title USING btree (emp_no, title, from_date);","isConstraint":true,"opclassNames":["int4_ops","text_ops","date_ops"],"opclassDefaults":[true,true,true]}],"rowCount":"1470","dataSize":"131072","indexSize":"73728","foreignKeys":[{"name":"title_emp_no_fkey","columns":["emp_no"],"referencedSchema":"public","referencedTable":"employee","referencedColumns":["emp_no"],"onDelete":"CASCADE","onUpdate":"NO ACTION","matchType":"SIMPLE"}],"owner":"bbsample"}],"views":[{"name":"current_dept_emp","definition":" SELECT l.emp_no,\n d.dept_no,\n l.from_date,\n l.to_date\n FROM (public.dept_emp d\n JOIN public.dept_emp_latest_date l ON (((d.emp_no = l.emp_no) AND (d.from_date = l.from_date) AND (l.to_date = d.to_date))));","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"dept_no"},{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"},{"schema":"public","table":"dept_emp_latest_date","column":"emp_no"},{"schema":"public","table":"dept_emp_latest_date","column":"from_date"},{"schema":"public","table":"dept_emp_latest_date","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"dept_no","position":2,"nullable":true,"type":"text"},{"name":"from_date","position":3,"nullable":true,"type":"date"},{"name":"to_date","position":4,"nullable":true,"type":"date"}]},{"name":"dept_emp_latest_date","definition":" SELECT emp_no,\n max(from_date) AS from_date,\n max(to_date) AS to_date\n FROM public.dept_emp\n GROUP BY emp_no;","dependencyColumns":[{"schema":"public","table":"dept_emp","column":"emp_no"},{"schema":"public","table":"dept_emp","column":"from_date"},{"schema":"public","table":"dept_emp","column":"to_date"}],"columns":[{"name":"emp_no","position":1,"nullable":true,"type":"integer"},{"name":"from_date","position":2,"nullable":true,"type":"date"},{"name":"to_date","position":3,"nullable":true,"type":"date"}]}],"functions":[{"name":"log_dml_operations","definition":"CREATE OR REPLACE FUNCTION public.log_dml_operations()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF (TG_OP = ''INSERT'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''INSERT'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''UPDATE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''UPDATE'', current_query(), current_user);\n RETURN NEW;\n ELSIF (TG_OP = ''DELETE'') THEN\n INSERT INTO audit (operation, query, user_name)\n VALUES (''DELETE'', current_query(), current_user);\n RETURN OLD;\n END IF;\n RETURN NULL;\nEND;\n$function$\n","signature":"log_dml_operations()"}],"sequences":[{"name":"audit_id_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"audit","ownerColumn":"id"},{"name":"employee_emp_no_seq","dataType":"integer","start":"1","minValue":"1","maxValue":"2147483647","increment":"1","cacheSize":"1","ownerTable":"employee","ownerColumn":"emp_no"}],"owner":"pg_database_owner","comment":"standard public schema"}],"characterSet":"UTF8","collation":"en_US.UTF-8","owner":"bbsample","searchPath":"\"$user\", public"}', 'SET statement_timeout = 0;SET lock_timeout = 0;SET idle_in_transaction_session_timeout = 0;@@ -2920,9 +2615,9 @@ ALTER TABLE "public"."title"-- Data for Name: instance; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.instance (id, deleted, environment, resource_id, metadata) VALUES (101, false, 'prod', 'bytebase-meta', '{"roles": [{"name": "bb", "attribute": "Superuser Create role Create DB Replication Bypass RLS+"}], "title": "bytebase-meta", "engine": "POSTGRES", "version": "16.0.0", "activation": true, "dataSources": [{"id": "35a64b4a-543f-4eac-ad32-b191a958c66d", "host": "/tmp", "port": "8082", "type": "ADMIN", "username": "bb", "authenticationType": "PASSWORD"}], "lastSyncTime": "2025-06-05T07:07:57.638515Z"}') ON CONFLICT DO NOTHING;-INSERT INTO public.instance (id, deleted, environment, resource_id, metadata) VALUES (103, false, 'prod', 'prod-sample-instance', '{"roles": [{"name": "bbsample", "attribute": "Superuser Create role Create DB Replication Bypass RLS+"}], "title": "Prod Sample Instance", "engine": "POSTGRES", "version": "16.0.0", "activation": true, "dataSources": [{"id": "9af4f227-a55e-4e82-b7f5-c7193b5f405c", "host": "/tmp", "port": "8084", "type": "ADMIN", "username": "bbsample", "authenticationType": "PASSWORD"}, {"id": "e700ae12-173e-4f0d-8590-0414cf6a9405", "host": "/tmp", "port": "8084", "type": "READ_ONLY", "username": "bbsample", "authenticationType": "PASSWORD"}], "lastSyncTime": "2025-06-05T07:07:57.649471Z"}') ON CONFLICT DO NOTHING;-INSERT INTO public.instance (id, deleted, environment, resource_id, metadata) VALUES (102, false, 'test', 'test-sample-instance', '{"roles": [{"name": "bbsample", "attribute": "Superuser Create role Create DB Replication Bypass RLS+"}], "title": "Test Sample Instance", "engine": "POSTGRES", "version": "16.0.0", "activation": true, "dataSources": [{"id": "a7f206f9-37c4-41ca-8b59-fcf4c6148105", "host": "/tmp", "port": "8083", "type": "ADMIN", "username": "bbsample", "authenticationType": "PASSWORD"}], "lastSyncTime": "2025-06-05T07:07:57.659121Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.instance (deleted, environment, resource_id, metadata) VALUES (false, 'prod', 'bytebase-meta', '{"roles": [{"name": "bb", "attribute": "Superuser Create role Create DB Replication Bypass RLS+"}], "title": "bytebase-meta", "engine": "POSTGRES", "version": "16.0.0", "activation": true, "dataSources": [{"id": "35a64b4a-543f-4eac-ad32-b191a958c66d", "host": "/tmp", "port": "8082", "type": "ADMIN", "username": "bb", "authenticationType": "PASSWORD"}], "lastSyncTime": "2025-06-05T07:07:57.638515Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.instance (deleted, environment, resource_id, metadata) VALUES (false, 'prod', 'prod-sample-instance', '{"roles": [{"name": "bbsample", "attribute": "Superuser Create role Create DB Replication Bypass RLS+"}], "title": "Prod Sample Instance", "engine": "POSTGRES", "version": "16.0.0", "activation": true, "dataSources": [{"id": "9af4f227-a55e-4e82-b7f5-c7193b5f405c", "host": "/tmp", "port": "8084", "type": "ADMIN", "username": "bbsample", "authenticationType": "PASSWORD"}, {"id": "e700ae12-173e-4f0d-8590-0414cf6a9405", "host": "/tmp", "port": "8084", "type": "READ_ONLY", "username": "bbsample", "authenticationType": "PASSWORD"}], "lastSyncTime": "2025-06-05T07:07:57.649471Z"}') ON CONFLICT DO NOTHING;+INSERT INTO public.instance (deleted, environment, resource_id, metadata) VALUES (false, 'test', 'test-sample-instance', '{"roles": [{"name": "bbsample", "attribute": "Superuser Create role Create DB Replication Bypass RLS+"}], "title": "Test Sample Instance", "engine": "POSTGRES", "version": "16.0.0", "activation": true, "dataSources": [{"id": "a7f206f9-37c4-41ca-8b59-fcf4c6148105", "host": "/tmp", "port": "8083", "type": "ADMIN", "username": "bbsample", "authenticationType": "PASSWORD"}], "lastSyncTime": "2025-06-05T07:07:57.659121Z"}') ON CONFLICT DO NOTHING;--@@ -3092,6 +2787,7 @@ INSERT INTO public.instance_change_history (id, version) VALUES (260, '3.15.10')INSERT INTO public.instance_change_history (id, version) VALUES (261, '3.15.11') ON CONFLICT DO NOTHING;INSERT INTO public.instance_change_history (id, version) VALUES (262, '3.16.0') ON CONFLICT DO NOTHING;INSERT INTO public.instance_change_history (id, version) VALUES (263, '3.16.1') ON CONFLICT DO NOTHING;+INSERT INTO public.instance_change_history (id, version) VALUES (264, '3.16.2') ON CONFLICT DO NOTHING;--@@ -3148,16 +2844,16 @@ INSERT INTO public.plan (id, created_at, updated_at, project, name, description,-- Data for Name: policy; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (104, true, '2025-05-26 08:47:09.079713+00', 'ENVIRONMENT', 'environments/test', 'TAG', '{"tags": {"bb.tag.review_config": "reviewConfigs/sql-review-sample-policy"}}', false) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (105, true, '2025-05-26 08:47:09.079724+00', 'ENVIRONMENT', 'environments/prod', 'TAG', '{"tags": {"bb.tag.review_config": "reviewConfigs/sql-review-sample-policy"}}', false) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (113, true, '2025-10-13 22:54:21.894178+00', 'ENVIRONMENT', 'environments/test', 'ROLLOUT', '{}', true) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (114, true, '2025-10-13 22:54:21.894178+00', 'ENVIRONMENT', 'environments/prod', 'ROLLOUT', '{}', true) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (111, true, '2026-03-10 08:21:23.909985+00', 'ENVIRONMENT', 'environments/prod', 'QUERY_DATA', '{"disallowDdl": true, "disallowDml": true, "disableCopyData": true, "adminDataSourceRestriction": "RESTRICTION_UNSPECIFIED."}', false) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (103, true, '2025-05-26 08:07:29.784956+00', 'PROJECT', 'projects/hr', 'IAM', '{"bindings": [{"role": "roles/projectOwner", "members": ["users/[email protected]"], "condition": {}}, {"role": "roles/projectDeveloper", "members": ["users/[email protected]"], "condition": {"title": "Project Developer All databases"}}]}', false) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (107, true, '2025-05-26 07:54:33.728664+00', 'PROJECT', 'projects/metadb', 'IAM', '{"bindings": [{"role": "roles/projectOwner", "members": ["users/[email protected]"], "condition": {}}, {"role": "roles/sqlEditorReadUser", "members": ["users/[email protected]", "users/[email protected]"], "condition": {"title": "SQL Editor User All databases"}}, {"role": "roles/sqlEditorUser", "members": ["users/[email protected]", "users/[email protected]"], "condition": {"expression": "resource.environment_id in [\"test\"]"}}]}', false) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (106, true, '2025-05-26 07:48:23.461198+00', 'WORKSPACE', 'workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48', 'MASKING_RULE', '{"rules": [{"id": "1f3018bb-f4ea-4daa-b4b3-6e32bce0d22e", "condition": {"expression": "resource.classification_level in [\"2\", \"3\"]"}, "semanticType": "bb.default-partial"}, {"id": "e0743172-c9c7-43f8-9923-9a3c06012cee", "condition": {"expression": "resource.classification_level in [\"4\"]"}, "semanticType": "bb.default"}]}', false) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (112, true, '2025-09-09 03:16:27.935445+00', 'WORKSPACE', 'workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48', 'QUERY_DATA', '{"disableExport": false, "maximumResultRows": -1}', true) ON CONFLICT DO NOTHING;-INSERT INTO public.policy (id, enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (101, true, '2025-05-26 08:10:00.958154+00', 'WORKSPACE', 'workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48', 'IAM', '{"bindings": [{"role": "roles/workspaceMember", "members": ["allUsers", "users/[email protected]", "users/[email protected]", "users/[email protected]", "groups/[email protected]"], "condition": {}}, {"role": "roles/workspaceAdmin", "members": ["users/[email protected]", "serviceAccounts/[email protected]"], "condition": {}}, {"role": "roles/workspaceDBA", "members": ["users/[email protected]", "users/[email protected]"], "condition": {}}, {"role": "roles/qa-custom-role", "members": ["groups/[email protected]"], "condition": {}}]}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-05-26 08:47:09.079713+00', 'ENVIRONMENT', 'environments/test', 'TAG', '{"tags": {"bb.tag.review_config": "reviewConfigs/sql-review-sample-policy"}}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-05-26 08:47:09.079724+00', 'ENVIRONMENT', 'environments/prod', 'TAG', '{"tags": {"bb.tag.review_config": "reviewConfigs/sql-review-sample-policy"}}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-10-13 22:54:21.894178+00', 'ENVIRONMENT', 'environments/test', 'ROLLOUT', '{}', true) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-10-13 22:54:21.894178+00', 'ENVIRONMENT', 'environments/prod', 'ROLLOUT', '{}', true) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2026-03-10 08:21:23.909985+00', 'ENVIRONMENT', 'environments/prod', 'QUERY_DATA', '{"disallowDdl": true, "disallowDml": true, "disableCopyData": true, "adminDataSourceRestriction": "RESTRICTION_UNSPECIFIED."}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-05-26 08:07:29.784956+00', 'PROJECT', 'projects/hr', 'IAM', '{"bindings": [{"role": "roles/projectOwner", "members": ["users/[email protected]"], "condition": {}}, {"role": "roles/projectDeveloper", "members": ["users/[email protected]"], "condition": {"title": "Project Developer All databases"}}]}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-05-26 07:54:33.728664+00', 'PROJECT', 'projects/metadb', 'IAM', '{"bindings": [{"role": "roles/projectOwner", "members": ["users/[email protected]"], "condition": {}}, {"role": "roles/sqlEditorReadUser", "members": ["users/[email protected]", "users/[email protected]"], "condition": {"title": "SQL Editor User All databases"}}, {"role": "roles/sqlEditorUser", "members": ["users/[email protected]", "users/[email protected]"], "condition": {"expression": "resource.environment_id in [\"test\"]"}}]}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-05-26 07:48:23.461198+00', 'WORKSPACE', 'workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48', 'MASKING_RULE', '{"rules": [{"id": "1f3018bb-f4ea-4daa-b4b3-6e32bce0d22e", "condition": {"expression": "resource.classification_level in [\"2\", \"3\"]"}, "semanticType": "bb.default-partial"}, {"id": "e0743172-c9c7-43f8-9923-9a3c06012cee", "condition": {"expression": "resource.classification_level in [\"4\"]"}, "semanticType": "bb.default"}]}', false) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-09-09 03:16:27.935445+00', 'WORKSPACE', 'workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48', 'QUERY_DATA', '{"disableExport": false, "maximumResultRows": -1}', true) ON CONFLICT DO NOTHING;+INSERT INTO public.policy (enforce, updated_at, resource_type, resource, type, payload, inherit_from_parent) VALUES (true, '2025-05-26 08:10:00.958154+00', 'WORKSPACE', 'workspaces/a6b014b9-d0d4-4974-9be6-53ec61ea5f48', 'IAM', '{"bindings": [{"role": "roles/workspaceMember", "members": ["allUsers", "users/[email protected]", "users/[email protected]", "users/[email protected]", "groups/[email protected]"], "condition": {}}, {"role": "roles/workspaceAdmin", "members": ["users/[email protected]", "serviceAccounts/[email protected]"], "condition": {}}, {"role": "roles/workspaceDBA", "members": ["users/[email protected]", "users/[email protected]"], "condition": {}}, {"role": "roles/qa-custom-role", "members": ["groups/[email protected]"], "condition": {}}]}', false) ON CONFLICT DO NOTHING;--@@ -3175,9 +2871,9 @@ INSERT INTO public.principal (id, deleted, created_at, name, email, password_has-- Data for Name: project; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.project (id, deleted, name, resource_id, setting) VALUES (102, false, 'Bytebase MetaDB', 'metadb', '{"allowRequestRole": true, "autoResolveIssue": true, "enforceIssueTitle": true, "allowModifyStatement": true, "dataClassificationConfigId": "e5680e79-e84b-486e-8cb2-76c984c3fac9"}') ON CONFLICT DO NOTHING;-INSERT INTO public.project (id, deleted, name, resource_id, setting) VALUES (1, false, 'Default', 'default', '{"allowRequestRole": true, "enforceIssueTitle": true, "dataClassificationConfigId": "e5680e79-e84b-486e-8cb2-76c984c3fac9"}') ON CONFLICT DO NOTHING;-INSERT INTO public.project (id, deleted, name, resource_id, setting) VALUES (101, false, 'HR Project', 'hr', '{"issueLabels": [{"color": "#4f46e5", "value": "3.6.2"}, {"color": "#E54646", "value": "bug"}, {"color": "#63E546", "value": "feature"}], "allowRequestRole": true, "autoResolveIssue": true, "allowSelfApproval": true, "enforceIssueTitle": true, "allowModifyStatement": true, "dataClassificationConfigId": "e5680e79-e84b-486e-8cb2-76c984c3fac9"}') ON CONFLICT DO NOTHING;+INSERT INTO public.project (deleted, name, resource_id, setting) VALUES (false, 'Bytebase MetaDB', 'metadb', '{"allowRequestRole": true, "autoResolveIssue": true, "enforceIssueTitle": true, "allowModifyStatement": true, "dataClassificationConfigId": "e5680e79-e84b-486e-8cb2-76c984c3fac9"}') ON CONFLICT DO NOTHING;+INSERT INTO public.project (deleted, name, resource_id, setting) VALUES (false, 'Default', 'default', '{"allowRequestRole": true, "enforceIssueTitle": true, "dataClassificationConfigId": "e5680e79-e84b-486e-8cb2-76c984c3fac9"}') ON CONFLICT DO NOTHING;+INSERT INTO public.project (deleted, name, resource_id, setting) VALUES (false, 'HR Project', 'hr', '{"issueLabels": [{"color": "#4f46e5", "value": "3.6.2"}, {"color": "#E54646", "value": "bug"}, {"color": "#63E546", "value": "feature"}], "allowRequestRole": true, "autoResolveIssue": true, "allowSelfApproval": true, "enforceIssueTitle": true, "allowModifyStatement": true, "dataClassificationConfigId": "e5680e79-e84b-486e-8cb2-76c984c3fac9"}') ON CONFLICT DO NOTHING;--@@ -3252,7 +2948,7 @@ ORDER BY-- Data for Name: replica_heartbeat; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.replica_heartbeat (replica_id, last_heartbeat) VALUES ('36064e86-8492-4eb2-a439-908c102e0a76', '2026-03-10 08:27:46.544158+00') ON CONFLICT DO NOTHING;+INSERT INTO public.replica_heartbeat (replica_id, last_heartbeat) VALUES ('bae1426c-717f-457f-8ccd-7b99b717b855', '2026-03-10 15:45:49.640487+00') ON CONFLICT DO NOTHING;--@@ -3272,7 +2968,7 @@ INSERT INTO public.review_config (id, enabled, name, payload) VALUES ('sql-revie-- Data for Name: role; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.role (id, resource_id, name, description, permissions, payload) VALUES (101, 'qa-custom-role', 'QA', 'Custom-defined QA role', '{"permissions": ["bb.databaseGroups.get", "bb.databaseGroups.list", "bb.databases.get", "bb.databases.getSchema", "bb.databases.list", "bb.issueComments.create", "bb.issues.get", "bb.issues.list", "bb.planCheckRuns.get", "bb.planCheckRuns.run", "bb.plans.get", "bb.plans.list", "bb.projects.get", "bb.projects.getIamPolicy", "bb.rollouts.get", "bb.taskRuns.list"]}', '{}') ON CONFLICT DO NOTHING;+INSERT INTO public.role (resource_id, name, description, permissions, payload) VALUES ('qa-custom-role', 'QA', 'Custom-defined QA role', '{"permissions": ["bb.databaseGroups.get", "bb.databaseGroups.list", "bb.databases.get", "bb.databases.getSchema", "bb.databases.list", "bb.issueComments.create", "bb.issues.get", "bb.issues.list", "bb.planCheckRuns.get", "bb.planCheckRuns.run", "bb.plans.get", "bb.plans.list", "bb.projects.get", "bb.projects.getIamPolicy", "bb.rollouts.get", "bb.taskRuns.list"]}', '{}') ON CONFLICT DO NOTHING;--@@ -3286,13 +2982,13 @@ INSERT INTO public.service_account (deleted, created_at, name, email, service_ke-- Data for Name: setting; Type: TABLE DATA; Schema: public; Owner: ----INSERT INTO public.setting (id, name, value) VALUES (113, 'ENVIRONMENT', '{"environments": [{"id": "test", "title": "Test"}, {"id": "prod", "tags": {"protected": "protected"}, "title": "Prod"}]}') ON CONFLICT DO NOTHING;-INSERT INTO public.setting (id, name, value) VALUES (128, 'SEMANTIC_TYPES', '{"types": [{"id": "bb.default", "title": "Default", "description": "Default type with full masking"}, {"id": "bb.default-partial", "title": "Default Partial", "description": "Default partial type with partial masking"}]}') ON CONFLICT DO NOTHING;-INSERT INTO public.setting (id, name, value) VALUES (110, 'DATA_CLASSIFICATION', '{"configs": [{"id": "e5680e79-e84b-486e-8cb2-76c984c3fac9", "title": "Classification Example", "levels": [{"id": "1", "title": "Level 1"}, {"id": "2", "title": "Level 2"}, {"id": "3", "title": "Level 3"}, {"id": "4", "title": "Level 4"}], "classification": {"1": {"id": "1", "title": "Basic"}, "2": {"id": "2", "title": "Relationship"}, "1-1": {"id": "1-1", "title": "Basic", "levelId": "1"}, "1-2": {"id": "1-2", "title": "Contact", "levelId": "2"}, "1-3": {"id": "1-3", "title": "Health", "levelId": "4"}, "2-1": {"id": "2-1", "title": "Social", "levelId": "1"}, "2-2": {"id": "2-2", "title": "Business", "levelId": "3"}}, "classificationFromConfig": true}]}') ON CONFLICT DO NOTHING;-INSERT INTO public.setting (id, name, value) VALUES (107, 'APP_IM', '{"settings": []}') ON CONFLICT DO NOTHING;-INSERT INTO public.setting (id, name, value) VALUES (111, 'WORKSPACE_APPROVAL', '{"rules": [{"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner-workspace-dba", "flow": {"roles": ["roles/projectOwner", "roles/workspaceDBA"]}, "title": " ALTER column in production environment is high risk (DDL)", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "(resource.environment_id == \"prod\" && statement.sql_type == \"ALTER_TABLE\") && !(statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"])"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner", "flow": {"roles": ["roles/projectOwner"]}, "title": "CREATE TABLE in production environment is moderate risk (DDL)", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "(resource.environment_id == \"prod\" && statement.sql_type == \"CREATE_TABLE\") && !(statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"])"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner", "flow": {"roles": ["roles/projectOwner"]}, "title": "Fallback rule (DDL)", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "!(statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"])"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner-workspace-dba", "flow": {"roles": ["roles/projectOwner", "roles/workspaceDBA"]}, "title": "Updated or deleted rows exceeds 100 in prod is high risk (DML)", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "(resource.environment_id == \"prod\" && statement.affected_rows > 100 && statement.sql_type in [\"UPDATE\", \"DELETE\"]) && statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"]"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner", "flow": {"roles": ["roles/projectOwner"]}, "title": "Fallback rule (DML)", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"]"}}]}') ON CONFLICT DO NOTHING;-INSERT INTO public.setting (id, name, value) VALUES (146, 'SYSTEM', '{"license": "eyJhbGciOiJSUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJpbnN0YW5jZUNvdW50Ijo5OTksInRyaWFsaW5nIjpmYWxzZSwicGxhbiI6IkVOVEVSUFJJU0UiLCJvcmdOYW1lIjoiYmIiLCJhdWQiOiJiYi5saWNlbnNlIiwiZXhwIjo3OTc0OTc5MjAwLCJpYXQiOjE2NjM2Njc1NjEsImlzcyI6ImJ5dGViYXNlIiwic3ViIjoiMDAwMDEwMDAuIn0.JjYCMeAAMB9FlVeDFLdN3jvFcqtPsbEzaIm1YEDhUrfekthCbIOeX_DB2Bg2OUji3HSX5uDvG9AkK4Gtrc4gLMPI3D5mk3L-6wUKZ0L4REztS47LT4oxVhpqPQayYa9lKJB1YoHaqeMV4Z5FXeOXwuACoELznlwpT6pXo9xXm_I6QwQiO7-zD83XOTO4PRjByc-q3GKQu_64zJMIKiCW0I8a3GvrdSnO7jUuYU1KPmCuk0ZRq3I91m29LTo478BMST59HqCLj1GGuCKtR3SL_376XsZfUUM0iSAur5scg99zNGWRj-sUo05wbAadYx6V6TKaWrBUi_8_0RnJyP5gbA", "authSecret": "l71IPJkuT7aTj7McDY3MSJ9BVqBAt2NQ", "workspaceId": "a6b014b9-d0d4-4974-9be6-53ec61ea5f48"}') ON CONFLICT DO NOTHING;-INSERT INTO public.setting (id, name, value) VALUES (112, 'WORKSPACE_PROFILE', '{"domains": ["example.com"], "watermark": true, "externalUrl": "https://demo.bytebase.com", "sqlResultSize": 104857600, "databaseChangeMode": "PIPELINE", "directorySyncToken": "3nnNo4tmEFH9FFyTACCfzGhyZUb4QsUC", "passwordRestriction": {"minLength": 8}, "enableMetricCollection": true}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('ENVIRONMENT', '{"environments": [{"id": "test", "title": "Test"}, {"id": "prod", "tags": {"protected": "protected"}, "title": "Prod"}]}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('SEMANTIC_TYPES', '{"types": [{"id": "bb.default", "title": "Default", "description": "Default type with full masking"}, {"id": "bb.default-partial", "title": "Default Partial", "description": "Default partial type with partial masking"}]}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('DATA_CLASSIFICATION', '{"configs": [{"id": "e5680e79-e84b-486e-8cb2-76c984c3fac9", "title": "Classification Example", "levels": [{"id": "1", "title": "Level 1"}, {"id": "2", "title": "Level 2"}, {"id": "3", "title": "Level 3"}, {"id": "4", "title": "Level 4"}], "classification": {"1": {"id": "1", "title": "Basic"}, "2": {"id": "2", "title": "Relationship"}, "1-1": {"id": "1-1", "title": "Basic", "levelId": "1"}, "1-2": {"id": "1-2", "title": "Contact", "levelId": "2"}, "1-3": {"id": "1-3", "title": "Health", "levelId": "4"}, "2-1": {"id": "2-1", "title": "Social", "levelId": "1"}, "2-2": {"id": "2-2", "title": "Business", "levelId": "3"}}, "classificationFromConfig": true}]}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('APP_IM', '{"settings": []}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('WORKSPACE_APPROVAL', '{"rules": [{"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner-workspace-dba", "flow": {"roles": ["roles/projectOwner", "roles/workspaceDBA"]}, "title": " ALTER column in production environment is high risk (DDL)", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "(resource.environment_id == \"prod\" && statement.sql_type == \"ALTER_TABLE\") && !(statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"])"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner", "flow": {"roles": ["roles/projectOwner"]}, "title": "CREATE TABLE in production environment is moderate risk (DDL)", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "(resource.environment_id == \"prod\" && statement.sql_type == \"CREATE_TABLE\") && !(statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"])"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner", "flow": {"roles": ["roles/projectOwner"]}, "title": "Fallback rule (DDL)", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "!(statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"])"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner-workspace-dba", "flow": {"roles": ["roles/projectOwner", "roles/workspaceDBA"]}, "title": "Updated or deleted rows exceeds 100 in prod is high risk (DML)", "description": "The system defines the approval process, first the project Owner approves, then the DBA approves."}, "condition": {"expression": "(resource.environment_id == \"prod\" && statement.affected_rows > 100 && statement.sql_type in [\"UPDATE\", \"DELETE\"]) && statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"]"}}, {"source": "CHANGE_DATABASE", "template": {"id": "bb.project-owner", "flow": {"roles": ["roles/projectOwner"]}, "title": "Fallback rule (DML)", "description": "The system defines the approval process and only needs the project Owner to approve it."}, "condition": {"expression": "statement.sql_type in [\"DELETE\", \"INSERT\", \"UPDATE\"]"}}]}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('SYSTEM', '{"license": "eyJhbGciOiJSUzI1NiIsImtpZCI6InYxIiwidHlwIjoiSldUIn0.eyJpbnN0YW5jZUNvdW50Ijo5OTksInRyaWFsaW5nIjpmYWxzZSwicGxhbiI6IkVOVEVSUFJJU0UiLCJvcmdOYW1lIjoiYmIiLCJhdWQiOiJiYi5saWNlbnNlIiwiZXhwIjo3OTc0OTc5MjAwLCJpYXQiOjE2NjM2Njc1NjEsImlzcyI6ImJ5dGViYXNlIiwic3ViIjoiMDAwMDEwMDAuIn0.JjYCMeAAMB9FlVeDFLdN3jvFcqtPsbEzaIm1YEDhUrfekthCbIOeX_DB2Bg2OUji3HSX5uDvG9AkK4Gtrc4gLMPI3D5mk3L-6wUKZ0L4REztS47LT4oxVhpqPQayYa9lKJB1YoHaqeMV4Z5FXeOXwuACoELznlwpT6pXo9xXm_I6QwQiO7-zD83XOTO4PRjByc-q3GKQu_64zJMIKiCW0I8a3GvrdSnO7jUuYU1KPmCuk0ZRq3I91m29LTo478BMST59HqCLj1GGuCKtR3SL_376XsZfUUM0iSAur5scg99zNGWRj-sUo05wbAadYx6V6TKaWrBUi_8_0RnJyP5gbA", "authSecret": "l71IPJkuT7aTj7McDY3MSJ9BVqBAt2NQ", "workspaceId": "a6b014b9-d0d4-4974-9be6-53ec61ea5f48"}') ON CONFLICT DO NOTHING;+INSERT INTO public.setting (name, value) VALUES ('WORKSPACE_PROFILE', '{"domains": ["example.com"], "watermark": true, "externalUrl": "https://demo.bytebase.com", "sqlResultSize": 104857600, "databaseChangeMode": "PIPELINE", "directorySyncToken": "3nnNo4tmEFH9FFyTACCfzGhyZUb4QsUC", "passwordRestriction": {"minLength": 8}, "enableMetricCollection": true}') ON CONFLICT DO NOTHING;--@@ -4815,27 +4511,6 @@ SELECT pg_catalog.setval('public.audit_log_id_seq', 193, true);SELECT pg_catalog.setval('public.changelog_id_seq', 108, true);------ Name: db_group_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.db_group_id_seq', 101, false);-------- Name: db_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.db_id_seq', 106, true);-------- Name: db_schema_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.db_schema_id_seq', 122, true);------ Name: export_archive_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ---@@ -4843,25 +4518,11 @@ SELECT pg_catalog.setval('public.db_schema_id_seq', 122, true);SELECT pg_catalog.setval('public.export_archive_id_seq', 1, false);------ Name: idp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.idp_id_seq', 101, false);------ Name: instance_change_history_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ----SELECT pg_catalog.setval('public.instance_change_history_id_seq', 263, true);-------- Name: instance_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.instance_id_seq', 103, true);+SELECT pg_catalog.setval('public.instance_change_history_id_seq', 264, true);--@@ -4892,13 +4553,6 @@ SELECT pg_catalog.setval('public.plan_check_run_id_seq', 106, true);SELECT pg_catalog.setval('public.plan_id_seq', 101, true);------ Name: policy_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.policy_id_seq', 115, true);------ Name: principal_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ---@@ -4906,13 +4560,6 @@ SELECT pg_catalog.setval('public.policy_id_seq', 115, true);SELECT pg_catalog.setval('public.principal_id_seq', 106, true);------ Name: project_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.project_id_seq', 102, true);------ Name: project_webhook_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ---@@ -4927,13 +4574,6 @@ SELECT pg_catalog.setval('public.project_webhook_id_seq', 101, false);SELECT pg_catalog.setval('public.query_history_id_seq', 105, true);------ Name: release_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.release_id_seq', 101, false);------ Name: revision_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ---@@ -4941,20 +4581,6 @@ SELECT pg_catalog.setval('public.release_id_seq', 101, false);SELECT pg_catalog.setval('public.revision_id_seq', 101, false);------ Name: role_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.role_id_seq', 101, true);-------- Name: setting_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.setting_id_seq', 147, true);------ Name: sync_history_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ---@@ -4976,13 +4602,6 @@ SELECT pg_catalog.setval('public.task_id_seq', 102, true);SELECT pg_catalog.setval('public.task_run_id_seq', 101, false);------ Name: task_run_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ------SELECT pg_catalog.setval('public.task_run_log_id_seq', 101, false);------ Name: worksheet_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ---@@ -5026,7 +4645,7 @@ ALTER TABLE ONLY public.changelog--ALTER TABLE ONLY public.db_group- ADD CONSTRAINT db_group_pkey PRIMARY KEY (id);+ ADD CONSTRAINT db_group_pkey PRIMARY KEY (project, resource_id);--@@ -5034,7 +4653,7 @@ ALTER TABLE ONLY public.db_group--ALTER TABLE ONLY public.db- ADD CONSTRAINT db_pkey PRIMARY KEY (id);+ ADD CONSTRAINT db_pkey PRIMARY KEY (instance, name);--@@ -5042,7 +4661,7 @@ ALTER TABLE ONLY public.db--ALTER TABLE ONLY public.db_schema- ADD CONSTRAINT db_schema_pkey PRIMARY KEY (id);+ ADD CONSTRAINT db_schema_pkey PRIMARY KEY (instance, db_name);--@@ -5058,7 +4677,7 @@ ALTER TABLE ONLY public.export_archive--ALTER TABLE ONLY public.idp- ADD CONSTRAINT idp_pkey PRIMARY KEY (id);+ ADD CONSTRAINT idp_pkey PRIMARY KEY (resource_id);--@@ -5074,7 +4693,7 @@ ALTER TABLE ONLY public.instance_change_history--ALTER TABLE ONLY public.instance- ADD CONSTRAINT instance_pkey PRIMARY KEY (id);+ ADD CONSTRAINT instance_pkey PRIMARY KEY (resource_id);--@@ -5146,7 +4765,7 @@ ALTER TABLE ONLY public.plan_webhook_delivery--ALTER TABLE ONLY public.policy- ADD CONSTRAINT policy_pkey PRIMARY KEY (id);+ ADD CONSTRAINT policy_pkey PRIMARY KEY (resource_type, resource, type);--@@ -5162,7 +4781,7 @@ ALTER TABLE ONLY public.principal--ALTER TABLE ONLY public.project- ADD CONSTRAINT project_pkey PRIMARY KEY (id);+ ADD CONSTRAINT project_pkey PRIMARY KEY (resource_id);--@@ -5186,7 +4805,7 @@ ALTER TABLE ONLY public.query_history--ALTER TABLE ONLY public.release- ADD CONSTRAINT release_pkey PRIMARY KEY (id);+ ADD CONSTRAINT release_pkey PRIMARY KEY (project, train, iteration);--@@ -5218,7 +4837,7 @@ ALTER TABLE ONLY public.revision--ALTER TABLE ONLY public.role- ADD CONSTRAINT role_pkey PRIMARY KEY (id);+ ADD CONSTRAINT role_pkey PRIMARY KEY (resource_id);--@@ -5234,7 +4853,7 @@ ALTER TABLE ONLY public.service_account--ALTER TABLE ONLY public.setting- ADD CONSTRAINT setting_pkey PRIMARY KEY (id);+ ADD CONSTRAINT setting_pkey PRIMARY KEY (name);--@@ -5266,7 +4885,7 @@ ALTER TABLE ONLY public.task--ALTER TABLE ONLY public.task_run_log- ADD CONSTRAINT task_run_log_pkey PRIMARY KEY (id);+ ADD CONSTRAINT task_run_log_pkey PRIMARY KEY (task_run_id, created_at);--@@ -5366,13 +4985,6 @@ CREATE INDEX idx_audit_log_payload_user ON public.audit_log USING btree (((payloCREATE INDEX idx_changelog_instance_db_name ON public.changelog USING btree (instance, db_name);------ Name: idx_db_group_unique_project_resource_id; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_db_group_unique_project_resource_id ON public.db_group USING btree (project, resource_id);------ Name: idx_db_project; Type: INDEX; Schema: public; Owner: ---@@ -5380,27 +4992,6 @@ CREATE UNIQUE INDEX idx_db_group_unique_project_resource_id ON public.db_group UCREATE INDEX idx_db_project ON public.db USING btree (project);------ Name: idx_db_schema_unique_instance_db_name; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_db_schema_unique_instance_db_name ON public.db_schema USING btree (instance, db_name);-------- Name: idx_db_unique_instance_name; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_db_unique_instance_name ON public.db USING btree (instance, name);-------- Name: idx_idp_unique_resource_id; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_idp_unique_resource_id ON public.idp USING btree (resource_id);------ Name: idx_instance_change_history_unique_version; Type: INDEX; Schema: public; Owner: ---@@ -5415,13 +5006,6 @@ CREATE UNIQUE INDEX idx_instance_change_history_unique_version ON public.instancCREATE INDEX idx_instance_metadata_engine ON public.instance USING btree (((metadata ->> 'engine'::text)));------ Name: idx_instance_unique_resource_id; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_instance_unique_resource_id ON public.instance USING btree (resource_id);------ Name: idx_issue_comment_issue_id; Type: INDEX; Schema: public; Owner: ---@@ -5513,13 +5097,6 @@ CREATE INDEX idx_plan_creator ON public.plan USING btree (creator);CREATE INDEX idx_plan_project ON public.plan USING btree (project);------ Name: idx_policy_unique_resource_type_resource_type; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_type ON public.policy USING btree (resource_type, resource, type);------ Name: idx_principal_unique_email; Type: INDEX; Schema: public; Owner: ---@@ -5527,13 +5104,6 @@ CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_type ON public.poliCREATE UNIQUE INDEX idx_principal_unique_email ON public.principal USING btree (email);------ Name: idx_project_unique_resource_id; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_project_unique_resource_id ON public.project USING btree (resource_id);------ Name: idx_project_webhook_project; Type: INDEX; Schema: public; Owner: ---@@ -5569,13 +5139,6 @@ CREATE INDEX idx_release_project ON public.release USING btree (project);CREATE INDEX idx_release_project_release_id ON public.release USING btree (project, release_id);------ Name: idx_release_project_train_iteration; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_release_project_train_iteration ON public.release USING btree (project, train, iteration);------ Name: idx_revision_instance_db_name_type_version; Type: INDEX; Schema: public; Owner: ---@@ -5590,13 +5153,6 @@ CREATE INDEX idx_revision_instance_db_name_type_version ON public.revision USINGCREATE UNIQUE INDEX idx_revision_unique_instance_db_name_type_version_deleted_at_nu ON public.revision USING btree (instance, db_name, ((payload ->> 'type'::text)), version) WHERE (deleted_at IS NULL);------ Name: idx_role_unique_resource_id; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_role_unique_resource_id ON public.role USING btree (resource_id);------ Name: idx_service_account_project; Type: INDEX; Schema: public; Owner: ---@@ -5604,13 +5160,6 @@ CREATE UNIQUE INDEX idx_role_unique_resource_id ON public.role USING btree (resoCREATE INDEX idx_service_account_project ON public.service_account USING btree (project) WHERE (project IS NOT NULL);------ Name: idx_setting_unique_name; Type: INDEX; Schema: public; Owner: ------CREATE UNIQUE INDEX idx_setting_unique_name ON public.setting USING btree (name);------ Name: idx_sync_history_instance_db_name_created_at; Type: INDEX; Schema: public; Owner: ---@@ -5960,4 +5509,3 @@ ALTER TABLE ONLY public.worksheet-- PostgreSQL database dump complete---diff --git a/backend/migrator/migration/3.16/0002##drop_unused_id_columns.sql b/backend/migrator/migration/3.16/0002##drop_unused_id_columns.sqlnew file mode 100644index 0000000000..0c5b720904--- /dev/null+++ b/backend/migrator/migration/3.16/0002##drop_unused_id_columns.sql@@ -0,0 +1,59 @@+-- Drop unused id columns from tables that already use natural keys.+-- No other tables have FK references to these id columns.+-- For tables whose unique indexes are referenced by FK constraints from other tables+-- (project, instance, db), we promote the existing unique index to PK using+-- ALTER TABLE ... ADD CONSTRAINT ... PRIMARY KEY USING INDEX to avoid FK dependency errors.++-- project: natural key = resource_id (FK referenced by many tables)+ALTER TABLE project DROP CONSTRAINT project_pkey;+ALTER TABLE project DROP COLUMN id;+ALTER TABLE project ADD CONSTRAINT project_pkey PRIMARY KEY USING INDEX idx_project_unique_resource_id;++-- instance: natural key = resource_id (FK referenced by db, task)+ALTER TABLE instance DROP CONSTRAINT instance_pkey;+ALTER TABLE instance DROP COLUMN id;+ALTER TABLE instance ADD CONSTRAINT instance_pkey PRIMARY KEY USING INDEX idx_instance_unique_resource_id;++-- db: natural key = (instance, name) (FK referenced by db_schema, revision, sync_history, changelog)+ALTER TABLE db DROP CONSTRAINT db_pkey;+ALTER TABLE db DROP COLUMN id;+ALTER TABLE db ADD CONSTRAINT db_pkey PRIMARY KEY USING INDEX idx_db_unique_instance_name;++-- setting: natural key = name+ALTER TABLE setting DROP COLUMN id;+ALTER TABLE setting ADD PRIMARY KEY (name);+DROP INDEX IF EXISTS idx_setting_unique_name;++-- policy: natural key = (resource_type, resource, type)+ALTER TABLE policy DROP COLUMN id;+ALTER TABLE policy ADD PRIMARY KEY (resource_type, resource, type);+DROP INDEX IF EXISTS idx_policy_unique_resource_type_resource_type;++-- idp: natural key = resource_id+ALTER TABLE idp DROP COLUMN id;+ALTER TABLE idp ADD PRIMARY KEY (resource_id);+DROP INDEX IF EXISTS idx_idp_unique_resource_id;++-- role: natural key = resource_id+ALTER TABLE role DROP COLUMN id;+ALTER TABLE role ADD PRIMARY KEY (resource_id);+DROP INDEX IF EXISTS idx_role_unique_resource_id;++-- db_schema: natural key = (instance, db_name)+ALTER TABLE db_schema DROP COLUMN id;+ALTER TABLE db_schema ADD PRIMARY KEY (instance, db_name);+DROP INDEX IF EXISTS idx_db_schema_unique_instance_db_name;++-- db_group: natural key = (project, resource_id)+ALTER TABLE db_group DROP COLUMN id;+ALTER TABLE db_group ADD PRIMARY KEY (project, resource_id);+DROP INDEX IF EXISTS idx_db_group_unique_project_resource_id;++-- task_run_log: use (task_run_id, created_at) as PK+ALTER TABLE task_run_log DROP COLUMN id;+ALTER TABLE task_run_log ADD PRIMARY KEY (task_run_id, created_at);++-- release: natural key = (project, train, iteration)+ALTER TABLE release DROP COLUMN id;+ALTER TABLE release ADD PRIMARY KEY (project, train, iteration);+DROP INDEX IF EXISTS idx_release_project_train_iteration;diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sqlindex c0a2c958f2..e06588f5cf 100644--- a/backend/migrator/migration/LATEST.sql+++ b/backend/migrator/migration/LATEST.sql@@ -1,7 +1,6 @@-- idp stores generic identity provider.CREATE TABLE idp (- id serial PRIMARY KEY,- resource_id text NOT NULL,+ resource_id text NOT NULL PRIMARY KEY,name text NOT NULL,domain text NOT NULL,type text NOT NULL CONSTRAINT idp_type_check CHECK (type IN ('OAUTH2', 'OIDC', 'LDAP')),@@ -10,24 +9,15 @@ CREATE TABLE idp (config jsonb NOT NULL DEFAULT '{}');-CREATE UNIQUE INDEX idx_idp_unique_resource_id ON idp(resource_id);--ALTER SEQUENCE idp_id_seq RESTART WITH 101;--- Project (created before principal for foreign key reference)CREATE TABLE project (- id serial PRIMARY KEY,+ resource_id text NOT NULL PRIMARY KEY,deleted boolean NOT NULL DEFAULT FALSE,name text NOT NULL,- resource_id text NOT NULL,-- Stored as Project (proto/store/store/project.proto)setting jsonb NOT NULL DEFAULT '{}');-CREATE UNIQUE INDEX idx_project_unique_resource_id ON project(resource_id);--ALTER SEQUENCE project_id_seq RESTART WITH 101;--- principalCREATE TABLE principal (id serial PRIMARY KEY,@@ -72,23 +62,17 @@ CREATE INDEX idx_workload_identity_project ON workload_identity(project) WHERE p-- SettingCREATE TABLE setting (- id serial PRIMARY KEY,-- name: SYSTEM, WORKSPACE_PROFILE, WORKSPACE_APPROVAL,-- APP_IM, AI, DATA_CLASSIFICATION, SEMANTIC_TYPES, ENVIRONMENT-- Enum: SettingName (proto/store/store/setting.proto)- name text NOT NULL,+ name text NOT NULL PRIMARY KEY,-- Stored as JSON marshalled by protojson.Marshal (camelCase keys)value jsonb NOT NULL);-CREATE UNIQUE INDEX idx_setting_unique_name ON setting(name);--ALTER SEQUENCE setting_id_seq RESTART WITH 101;--- RoleCREATE TABLE role (- id bigserial PRIMARY KEY,- resource_id text NOT NULL,+ resource_id text NOT NULL PRIMARY KEY,name text NOT NULL,description text NOT NULL,-- Stored as RolePermissions (proto/store/store/role.proto)@@ -97,14 +81,9 @@ CREATE TABLE role (payload jsonb NOT NULL DEFAULT '{}');-CREATE UNIQUE INDEX idx_role_unique_resource_id on role (resource_id);--ALTER SEQUENCE role_id_seq RESTART WITH 101;--- Policy-- policy stores the policies for each resources.CREATE TABLE policy (- id serial PRIMARY KEY,enforce boolean NOT NULL DEFAULT TRUE,updated_at timestamptz NOT NULL DEFAULT now(),-- resource_type: WORKSPACE, ENVIRONMENT, PROJECT@@ -123,13 +102,10 @@ CREATE TABLE policy (-- IAM: IamPolicy-- TAG: TagPolicypayload jsonb NOT NULL DEFAULT '{}',- inherit_from_parent boolean NOT NULL DEFAULT TRUE+ inherit_from_parent boolean NOT NULL DEFAULT TRUE,+ PRIMARY KEY (resource_type, resource, type));-CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_type ON policy(resource_type, resource, type);--ALTER SEQUENCE policy_id_seq RESTART WITH 101;--- Project HookCREATE TABLE project_webhook (id serial PRIMARY KEY,@@ -144,42 +120,32 @@ ALTER SEQUENCE project_webhook_id_seq RESTART WITH 101;-- InstanceCREATE TABLE instance (- id serial PRIMARY KEY,+ resource_id text NOT NULL PRIMARY KEY,deleted boolean NOT NULL DEFAULT FALSE,environment text,- resource_id text NOT NULL,-- Stored as Instance (proto/store/store/instance.proto)metadata jsonb NOT NULL DEFAULT '{}');-CREATE UNIQUE INDEX idx_instance_unique_resource_id ON instance(resource_id);-CREATE INDEX idx_instance_metadata_engine ON instance((metadata->>'engine'));-ALTER SEQUENCE instance_id_seq RESTART WITH 101;--- db stores the databases for a particular instance-- data is synced periodically from the instanceCREATE TABLE db (- id serial PRIMARY KEY,- deleted boolean NOT NULL DEFAULT FALSE,- project text NOT NULL REFERENCES project(resource_id),instance text NOT NULL REFERENCES instance(resource_id),name text NOT NULL,+ deleted boolean NOT NULL DEFAULT FALSE,+ project text NOT NULL REFERENCES project(resource_id),environment text,-- Stored as DatabaseMetadata (proto/store/store/database.proto)- metadata jsonb NOT NULL DEFAULT '{}'+ metadata jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (instance, name));CREATE INDEX idx_db_project ON db(project);-CREATE UNIQUE INDEX idx_db_unique_instance_name ON db(instance, name);--ALTER SEQUENCE db_id_seq RESTART WITH 101;--- db_schema stores the database schema metadata for a particular database.CREATE TABLE db_schema (- id serial PRIMARY KEY,instance text NOT NULL,db_name text NOT NULL,-- Stored as DatabaseSchemaMetadata (proto/store/store/database.proto)@@ -187,13 +153,10 @@ CREATE TABLE db_schema (raw_dump text NOT NULL DEFAULT '',-- Stored as DatabaseConfig (proto/store/store/database.proto)config jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (instance, db_name),CONSTRAINT db_schema_instance_db_name_fkey FOREIGN KEY(instance, db_name) REFERENCES db(instance, name));-CREATE UNIQUE INDEX idx_db_schema_unique_instance_db_name ON db_schema(instance, db_name);--ALTER SEQUENCE db_schema_id_seq RESTART WITH 101;-CREATE TABLE sheet_blob (sha256 bytea NOT NULL PRIMARY KEY,content text NOT NULL@@ -301,17 +264,13 @@ CREATE TABLE replica_heartbeat ();CREATE TABLE task_run_log (- id bigserial PRIMARY KEY,task_run_id integer NOT NULL REFERENCES task_run(id),created_at timestamptz NOT NULL DEFAULT now(),-- Stored as TaskRunLog (proto/store/store/task_run_log.proto)- payload jsonb NOT NULL DEFAULT '{}'+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (task_run_id, created_at));-CREATE INDEX idx_task_run_log_task_run_id ON task_run_log(task_run_id);--ALTER SEQUENCE task_run_log_id_seq RESTART WITH 101;--- Pipeline related END------------------------- issue@@ -440,20 +399,16 @@ CREATE INDEX idx_worksheet_organizer_principal ON worksheet_organizer(principal)CREATE INDEX idx_worksheet_organizer_payload ON worksheet_organizer USING GIN(payload);CREATE TABLE db_group (- id bigserial PRIMARY KEY,project text NOT NULL REFERENCES project(resource_id),resource_id text NOT NULL,name text NOT NULL DEFAULT '',-- Stored as google.type.Expr (from Google Common Expression Language)expression jsonb NOT NULL DEFAULT '{}',-- Stored as DatabaseGroupPayload (proto/store/store/db_group.proto)- payload jsonb NOT NULL DEFAULT '{}'+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (project, resource_id));-CREATE UNIQUE INDEX idx_db_group_unique_project_resource_id ON db_group(project, resource_id);--ALTER SEQUENCE db_group_id_seq RESTART WITH 101;-CREATE TABLE export_archive (id serial PRIMARY KEY,created_at timestamptz NOT NULL DEFAULT now(),@@ -533,23 +488,20 @@ ALTER SEQUENCE changelog_id_seq RESTART WITH 101;CREATE INDEX idx_changelog_instance_db_name ON changelog (instance, db_name);CREATE TABLE release (- id bigserial PRIMARY KEY,- deleted boolean NOT NULL DEFAULT FALSE,project text NOT NULL REFERENCES project(resource_id),+ train text NOT NULL DEFAULT '',+ iteration integer NOT NULL DEFAULT 0,+ deleted boolean NOT NULL DEFAULT FALSE,release_id text NOT NULL DEFAULT '',creator text NOT NULL,created_at timestamptz NOT NULL DEFAULT now(),- train text NOT NULL DEFAULT '',- iteration integer NOT NULL DEFAULT 0,category text NOT NULL DEFAULT '',-- Stored as ReleasePayload (proto/store/store/release.proto)- payload jsonb NOT NULL DEFAULT '{}'+ payload jsonb NOT NULL DEFAULT '{}',+ PRIMARY KEY (project, train, iteration));-ALTER SEQUENCE release_id_seq RESTART WITH 101;-CREATE INDEX idx_release_project ON release(project);-CREATE UNIQUE INDEX idx_release_project_train_iteration ON release(project, train, iteration);CREATE INDEX idx_release_project_release_id ON release(project, release_id);CREATE INDEX idx_release_category ON release(project, category);@@ -607,9 +559,7 @@ CREATE TABLE access_grant (CREATE INDEX idx_access_grant_project_creator_expire_time ON access_grant(project, creator, expire_time);-- Default project.-INSERT INTO project (id, name, resource_id) VALUES (1, 'Default', 'default');--ALTER SEQUENCE project_id_seq RESTART WITH 101;+INSERT INTO project (name, resource_id) VALUES ('Default', 'default');-- Initialize settings with static valuesINSERT INTO setting (name, value) VALUES ('APP_IM', '{}'::jsonb);diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.goindex 03a4f5f63a..19e1f3af57 100644--- a/backend/migrator/migrator_test.go+++ b/backend/migrator/migrator_test.go@@ -15,8 +15,8 @@ import (func TestLatestVersion(t *testing.T) {files, err := getSortedVersionedFiles()require.NoError(t, err)- require.Equal(t, semver.MustParse("3.16.1"), *files[len(files)-1].version)- require.Equal(t, "migration/3.16/0001##fix_workspace_policy_resource.sql", files[len(files)-1].path)+ require.Equal(t, semver.MustParse("3.16.2"), *files[len(files)-1].version)+ require.Equal(t, "migration/3.16/0002##drop_unused_id_columns.sql", files[len(files)-1].path)}func TestVersionUnique(t *testing.T) {diff --git a/backend/store/database.go b/backend/store/database.goindex 95aea92973..3f67f5a468 100644--- a/backend/store/database.go+++ b/backend/store/database.go@@ -243,8 +243,7 @@ func (s *Store) CreateDatabaseDefault(ctx context.Context, create *DatabaseMessa)VALUES (?, ?, ?, ?)ON CONFLICT (instance, name) DO UPDATE SET- deleted = EXCLUDED.deleted- RETURNING id`,+ deleted = EXCLUDED.deleted`,create.InstanceID,create.ProjectID,create.DatabaseName,@@ -256,8 +255,7 @@ func (s *Store) CreateDatabaseDefault(ctx context.Context, create *DatabaseMessareturn nil, errors.Wrapf(err, "failed to build sql")}- var databaseUID int- if err := s.GetDB().QueryRowContext(ctx, query, args...).Scan(&databaseUID); err != nil {+ if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {return nil, err}@@ -292,8 +290,7 @@ func (s *Store) UpsertDatabase(ctx context.Context, create *DatabaseMessage) (*Dproject = EXCLUDED.project,environment = EXCLUDED.environment,name = EXCLUDED.name,- metadata = EXCLUDED.metadata- RETURNING id`,+ metadata = EXCLUDED.metadata`,create.InstanceID,create.ProjectID,environment,@@ -307,8 +304,7 @@ func (s *Store) UpsertDatabase(ctx context.Context, create *DatabaseMessage) (*Dreturn nil, errors.Wrapf(err, "failed to build sql")}- var databaseUID int- if err := s.GetDB().QueryRowContext(ctx, query, args...).Scan(&databaseUID); err != nil {+ if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {return nil, err}@@ -357,15 +353,14 @@ func (s *Store) UpdateDatabase(ctx context.Context, patch *UpdateDatabaseMessagereturn nil, errors.New("no fields to update")}- q := qb.Q().Space("UPDATE db SET ? WHERE instance = ? AND name = ? RETURNING id", set, patch.InstanceID, patch.DatabaseName)+ q := qb.Q().Space("UPDATE db SET ? WHERE instance = ? AND name = ?", set, patch.InstanceID, patch.DatabaseName)query, args, err := q.ToSQL()if err != nil {return nil, errors.Wrapf(err, "failed to build sql")}- var databaseUID int- if err := s.GetDB().QueryRowContext(ctx, query, args...).Scan(&databaseUID); err != nil {+ if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {return nil, err}diff --git a/backend/store/idp.go b/backend/store/idp.goindex 93083f8366..21b33de510 100644--- a/backend/store/idp.go+++ b/backend/store/idp.go@@ -119,7 +119,7 @@ func (s *Store) ListIdentityProviders(ctx context.Context, find *FindIdentityProq.And("resource_id = ?", *v)}- q.Space("ORDER BY id ASC")+ q.Space("ORDER BY resource_id ASC")query, args, err := q.ToSQL()if err != nil {diff --git a/backend/store/release.go b/backend/store/release.goindex 02c83c31e7..821cbeabae 100644--- a/backend/store/release.go+++ b/backend/store/release.go@@ -95,7 +95,7 @@ func (s *Store) CreateRelease(ctx context.Context, release *ReleaseMessage, crea?,?,?- ) RETURNING id, created_at+ ) RETURNING created_at`, creator, release.ProjectID, p, releaseID, release.Train, nextIteration, release.Category)query, args, err := q.ToSQL()@@ -104,8 +104,7 @@ func (s *Store) CreateRelease(ctx context.Context, release *ReleaseMessage, crea}var createdTime time.Time- var id int64 // Still needed for RETURNING clause- if err := tx.QueryRowContext(ctx, query, args...).Scan(&id, &createdTime); err != nil {+ if err := tx.QueryRowContext(ctx, query, args...).Scan(&createdTime); err != nil {return nil, errors.Wrapf(err, "failed to insert release")}@@ -164,7 +163,7 @@ func (s *Store) ListReleases(ctx context.Context, find *FindReleaseMessage) ([]*q.And("deleted = ?", false)}- q.Space("ORDER BY release.id DESC")+ q.Space("ORDER BY release.created_at DESC")if v := find.Limit; v != nil {q.Space("LIMIT ?", *v)}diff --git a/backend/store/task_run_log.go b/backend/store/task_run_log.goindex 8b5713c4f7..0001ce3404 100644--- a/backend/store/task_run_log.go+++ b/backend/store/task_run_log.go@@ -62,7 +62,7 @@ func (s *Store) ListTaskRunLogs(ctx context.Context, taskRunUID int) ([]*TaskRunpayloadFROM task_run_logWHERE task_run_log.task_run_id = ?- ORDER BY id+ ORDER BY created_at`, taskRunUID)sql, args, err := q.ToSQL()diff --git a/docs/plans/saas/01.prepare-for-saas.md b/docs/plans/saas/01.prepare-for-saas.mdindex 7663ac17ee..cdc1565014 100644--- a/docs/plans/saas/01.prepare-for-saas.md+++ b/docs/plans/saas/01.prepare-for-saas.md@@ -276,136 +276,88 @@ These tables already use string/email identifiers (no change needed):- `review_config` -- text PK- `access_grant` -- UUID text PK-### Migration Plan+### Current Store Layer Details-**Phase 1: Add `resource_id` column to API-exposed tables**+| Table | Message Field | Parsed Return Type | FK Dependents |+|-------|--------------|-------------------|---------------|+| `plan` | `UID int64` | `int64` via `GetProjectIDPlanID()` | `task.plan_id`, `issue.plan_id`, `plan_check_run.plan_id`, `plan_webhook_delivery.plan_id` |+| `task` | `ID int` | `int` via `GetProjectIDPlanIDStageIDTaskID()` | `task_run.task_id` |+| `task_run` | `ID int` | `int` via `GetProjectIDPlanIDStageIDTaskIDTaskRunID()` | `task_run_log.task_run_id` |+| `issue` | `UID int` | `int` via `GetProjectIDIssueUID()` | `issue_comment.issue_id` |+| `issue_comment` | `UID int` | `int` via `GetProjectIDIssueUIDIssueCommentUID()` | None |+| `revision` | `UID int64` | `int64` via `GetInstanceDatabaseRevisionID()` | None |+| `changelog` | `UID int64` | `int64` via `GetInstanceDatabaseChangelogUID()` | None (FK to `sync_history` is internal) |+| `worksheet` | `UID int` | `int` via `GetWorksheetUID()` | `worksheet_organizer.worksheet_id` |+| `project_webhook` | `ID int` | `int` (no dedicated parser yet) | None |-Add a new `text` column with a generated default, backfill existing rows, then switch the API to use it. This allows a zero-downtime migration.+### JSONB / Proto Fields Storing Integer IDs-```sql--- For each API-exposed table, add resource_id column.--- Use gen_random_uuid() for simplicity; can switch to nanoid if preferred.-ALTER TABLE plan ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE task ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE task_run ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE issue ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE issue_comment ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE revision ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE changelog ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE worksheet ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;-ALTER TABLE project_webhook ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+These serialized fields embed integer IDs and need migration alongside the tables:--- Create unique indexes-CREATE UNIQUE INDEX idx_plan_unique_resource_id ON plan(resource_id);-CREATE UNIQUE INDEX idx_task_unique_resource_id ON task(resource_id);-CREATE UNIQUE INDEX idx_task_run_unique_resource_id ON task_run(resource_id);-CREATE UNIQUE INDEX idx_issue_unique_resource_id ON issue(resource_id);-CREATE UNIQUE INDEX idx_issue_comment_unique_resource_id ON issue_comment(resource_id);-CREATE UNIQUE INDEX idx_revision_unique_resource_id ON revision(resource_id);-CREATE UNIQUE INDEX idx_changelog_unique_resource_id ON changelog(resource_id);-CREATE UNIQUE INDEX idx_worksheet_unique_resource_id ON worksheet(resource_id);-CREATE UNIQUE INDEX idx_project_webhook_unique_resource_id ON project_webhook(resource_id);-```+| JSONB Location | Proto Field | Type | References |+|---------------|-------------|------|-----------|+| `access_grant.payload` | `AccessGrantPayload.issue_id` | `int64` | `issue.id` |+| `task_run.result` | `TaskRunResult.export_archive_uid` | `int32` | `export_archive.id` (internal) |+| PG NOTIFY channel | `Signal.uid` | `int32` | `task_run.id` or `plan_check_run.uid` |-**Phase 2: Switch API layer to use `resource_id`**+### FK Dependency Graph-Update resource name parsing functions in `backend/common/resource_name.go`:-- `GetProjectIDPlanID()` -- return `string` instead of `int64`-- `GetProjectIDIssueUID()` -- return `string` instead of `int`-- `GetWorksheetUID()` -- return `string` instead of `int`-- etc.+Migration must proceed bottom-up through the FK chain:-Update store `FindXxxMessage` structs to use `ResourceID *string` instead of `UID *int`.--**Phase 3: Migrate FK references from integer to string**--Tables that reference these IDs via FK need to be updated:--| FK column | References | Action |-|-----------|-----------|--------|-| `task.plan_id` | `plan(id)` | Change to `plan_resource_id text REFERENCES plan(resource_id)` |-| `task_run.task_id` | `task(id)` | Change to `task_resource_id text REFERENCES task(resource_id)` |-| `task_run_log.task_run_id` | `task_run(id)` | Change to `task_run_resource_id text REFERENCES task_run(resource_id)` |-| `issue.plan_id` | `plan(id)` | Change to `plan_resource_id text REFERENCES plan(resource_id)` |-| `issue_comment.issue_id` | `issue(id)` | Change to `issue_resource_id text REFERENCES issue(resource_id)` |-| `worksheet_organizer.worksheet_id` | `worksheet(id)` | Change to `worksheet_resource_id text REFERENCES worksheet(resource_id)` |-| `changelog.sync_history_id` | `sync_history(id)` | Keep as-is (internal, not exposed in API) |-| `plan_check_run.plan_id` | `plan(id)` | Change to `plan_resource_id text REFERENCES plan(resource_id)` |-| `plan_webhook_delivery.plan_id` | `plan(id)` | Change to `plan_resource_id text REFERENCES plan(resource_id)` |--**Phase 4: Drop integer `id` columns from API-exposed tables**--After all FK references are migrated, drop the old integer `id` columns and promote `resource_id` to primary key (same approach as Section 4).--### Code Changes--- **`backend/common/resource_name.go`** -- All `GetXxxID()` functions return `string` instead of `int`/`int64`. Remove `strconv.Atoi()`/`strconv.ParseInt()` calls.-- **Store message types** -- Change `ID int` / `UID int` fields to `ResourceID string`.-- **Store SQL** -- Update all `WHERE id = ?` to `WHERE resource_id = ?`, all `RETURNING id` to `RETURNING resource_id`.-- **Proto** -- No change needed (resource names are already strings in the proto API).-- **Frontend** -- No change needed (the frontend already treats resource IDs as opaque strings in URL paths).--### Internal-Only Tables--The 4 tables with internal-only integer IDs (`sync_history`, `query_history`, `export_archive`, `worksheet_organizer`) can keep integer IDs since they are never exposed in API paths. However, for consistency, consider migrating them in a follow-up.-------## 4. Remove Unused `id` Columns+```+plan ← task ← task_run ← task_run_log+ ↑ ↑+ │ └─ (task_run has UNIQUE(task_id, attempt))+ ├─ issue ← issue_comment+ ├─ plan_check_run (UNIQUE on plan_id, singleton)+ └─ plan_webhook_delivery (plan_id is PK)++worksheet ← worksheet_organizer (ON DELETE CASCADE)++revision (standalone)+changelog (standalone, FK to sync_history is internal)+project_webhook (standalone)+```-### Why+### Migration Plan-Many tables have a `serial`/`bigserial` `id` column as the PRIMARY KEY but never use it for queries -- all lookups, JOINs, and foreign keys use natural keys (`resource_id`, `email`, `name`, composite unique constraints). These unused `id` columns add unnecessary overhead and complicate the schema. Removing them simplifies the data model and makes the natural keys the explicit primary keys.+**Phase 0: Drop unused `id` columns from tables that already use natural keys**-**Relationship with Section 3:** Section 3 migrates tables that DO use their integer `id` to string `resource_id`. This section removes the `id` column from tables that DON'T use it at all. Both sections can be done independently.+Many tables have a `serial`/`bigserial` `id` column as PRIMARY KEY but never use it -- all lookups, JOINs, and foreign keys use natural keys (`resource_id`, `email`, composite unique constraints). No other tables have FK references to these `id` columns. Dropping them simplifies the schema before adding `resource_id` to the API-exposed tables.-### Tables with Unused `id` Columns+11 tables have completely unused `id` columns:-| Table | Natural Key | `id` usage | FK references to `id`? |-|-------|------------|------------|----------------------|+| Table | Natural Key | `id` usage in store | FK references to `id`? |+|-------|------------|-------------------|----------------------|+| `project` | `resource_id` (unique) | None | No (FKs use `resource_id`) |+| `instance` | `resource_id` (unique) | None | No (FKs use `resource_id`) |+| `db` | `(instance, name)` (unique) | `RETURNING id` (scanned but discarded) | No (FKs use `(instance, name)`) || `setting` | `name` (unique) | None | No || `policy` | `(resource_type, resource, type)` (unique) | None | No || `idp` | `resource_id` (unique) | `ORDER BY id` only | No || `role` | `resource_id` (unique) | None | No || `db_schema` | `(instance, db_name)` (unique) | None | No || `db_group` | `(project, resource_id)` (unique) | None | No |-| `project` | `resource_id` (unique) | None | No (FKs use `resource_id`) |-| `instance` | `resource_id` (unique) | None | No (FKs use `resource_id`) |-| `db` | `(instance, name)` (unique) | None | No (FKs use `(instance, name)`) || `task_run_log` | `task_run_id` (FK) | `ORDER BY id` only | No || `release` | `(project, train, iteration)` (unique) | `RETURNING id` (discarded), `ORDER BY id` | No |-| `instance_change_history` | `version` (unique) | No store file (legacy table) | No |--### Tables Where `id` IS Used (Keep or Migrate per Section 3)--These tables actively use `id` in WHERE/JOIN or have FK references from other tables. Tables marked with ★ are covered by Section 3 (migrate integer `id` → string `resource_id`):--| Table | Why `id` is needed | Section 3? |-|-------|-------------------|-----------|-| `plan` | FK from `task`, `issue`, `plan_check_run`, `plan_webhook_delivery` | ★ API-exposed |-| `task` | FK from `task_run` | ★ API-exposed |-| `task_run` | FK from `task_run_log`; used in WHERE for lookups | ★ API-exposed |-| `issue` | FK from `issue_comment`; used in WHERE for lookups | ★ API-exposed |-| `issue_comment` | Used in WHERE/UPDATE by id | ★ API-exposed |-| `revision` | Used in WHERE/DELETE by id | ★ API-exposed |-| `changelog` | Used in WHERE/UPDATE by id | ★ API-exposed |-| `worksheet` | FK from `worksheet_organizer`; used in WHERE/DELETE | ★ API-exposed |-| `project_webhook` | Used in WHERE/UPDATE/DELETE by id | ★ API-exposed |-| `plan_check_run` | Used in WHERE/UPDATE by id | Singleton (no id in API path) |-| `sync_history` | FK from `changelog`; used in WHERE for lookups | Internal only |-| `principal` | Used in WHERE/UPDATE by id | Uses email |-| `service_account` | Used in WHERE/UPDATE by id | Uses email |-| `workload_identity` | Used in WHERE/UPDATE by id | Uses email |-| `audit_log` | Used in ORDER BY, stored in message | Internal only |-| `query_history` | Used in ORDER BY, stored in message | Internal only |-| `export_archive` | Used in WHERE/DELETE by id | Internal only |-| `worksheet_organizer` | Stored in message | Internal only |-### Migration SQL+**Excluded:** `instance_change_history` -- the migrator uses `ORDER BY id DESC` to find the latest applied version, and since `version` is a semver text column, lexicographic sort does not work. Keep `id` here.++Migration SQL:```sql--- For each table, drop the id column and promote the natural key to PRIMARY KEY.--- Order matters: drop tables with no dependents first.+-- project: natural key = resource_id+ALTER TABLE project DROP COLUMN id;+ALTER TABLE project ADD PRIMARY KEY (resource_id);++-- instance: natural key = resource_id+ALTER TABLE instance DROP COLUMN id;+ALTER TABLE instance ADD PRIMARY KEY (resource_id);++-- db: natural key = (instance, name)+ALTER TABLE db DROP COLUMN id;+ALTER TABLE db ADD PRIMARY KEY (instance, name);+DROP INDEX IF EXISTS idx_db_unique_instance_name;-- setting: natural key = nameALTER TABLE setting DROP COLUMN id;@@ -433,19 +385,6 @@ ALTER TABLE db_group DROP COLUMN id;ALTER TABLE db_group ADD PRIMARY KEY (project, resource_id);DROP INDEX IF EXISTS idx_db_group_unique_project_resource_id;--- project: natural key = resource_id-ALTER TABLE project DROP COLUMN id;-ALTER TABLE project ADD PRIMARY KEY (resource_id);---- instance: natural key = resource_id-ALTER TABLE instance DROP COLUMN id;-ALTER TABLE instance ADD PRIMARY KEY (resource_id);---- db: natural key = (instance, name)-ALTER TABLE db DROP COLUMN id;-ALTER TABLE db ADD PRIMARY KEY (instance, name);-DROP INDEX IF EXISTS idx_db_unique_instance_name;--- task_run_log: no natural PK, use task_run_id + created_atALTER TABLE task_run_log DROP COLUMN id;ALTER TABLE task_run_log ADD PRIMARY KEY (task_run_id, created_at);@@ -454,16 +393,122 @@ ALTER TABLE task_run_log ADD PRIMARY KEY (task_run_id, created_at);ALTER TABLE release DROP COLUMN id;ALTER TABLE release ADD PRIMARY KEY (project, train, iteration);DROP INDEX IF EXISTS idx_release_project_train_iteration;+```++Code changes:++- **database.go**: Replace `RETURNING id` with `RETURNING instance, name` (or just remove it and use `ExecContext` instead of `QueryRowContext` since the returned value is discarded). 3 places: `CreateDatabase`, `UpsertDatabase`, `UpdateDatabase`.+- **release.go**: Change `RETURNING id, created_at` to `RETURNING created_at`. Remove `var id int64` scan variable.+- **idp.go**: Replace `ORDER BY id ASC` with `ORDER BY resource_id ASC`.+- **task_run_log.go**: Replace `ORDER BY id` with `ORDER BY created_at`.+- **release.go**: Replace `ORDER BY release.id DESC` with `ORDER BY release.created_at DESC`.+- **LATEST.sql**: Update table definitions to remove `id` columns, remove `ALTER SEQUENCE ... RESTART` statements, promote natural keys to PRIMARY KEY, drop redundant unique indexes.+- **migrator_test.go**: Update `TestLatestVersion`.--- instance_change_history: natural key = version-ALTER TABLE instance_change_history DROP COLUMN id;-ALTER TABLE instance_change_history ADD PRIMARY KEY (version);-DROP INDEX IF EXISTS idx_instance_change_history_unique_version;+**Phase 1: Add `resource_id` column to API-exposed tables (DB-only, no code changes)**++```sql+-- For each API-exposed table, add resource_id column.+-- Use gen_random_uuid() for simplicity; can switch to nanoid if preferred.+ALTER TABLE plan ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE task ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE task_run ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE issue ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE issue_comment ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE revision ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE changelog ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE worksheet ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;+ALTER TABLE project_webhook ADD COLUMN resource_id text NOT NULL DEFAULT gen_random_uuid()::text;++-- Create unique indexes+CREATE UNIQUE INDEX idx_plan_unique_resource_id ON plan(resource_id);+CREATE UNIQUE INDEX idx_task_unique_resource_id ON task(resource_id);+CREATE UNIQUE INDEX idx_task_run_unique_resource_id ON task_run(resource_id);+CREATE UNIQUE INDEX idx_issue_unique_resource_id ON issue(resource_id);+CREATE UNIQUE INDEX idx_issue_comment_unique_resource_id ON issue_comment(resource_id);+CREATE UNIQUE INDEX idx_revision_unique_resource_id ON revision(resource_id);+CREATE UNIQUE INDEX idx_changelog_unique_resource_id ON changelog(resource_id);+CREATE UNIQUE INDEX idx_worksheet_unique_resource_id ON worksheet(resource_id);+CREATE UNIQUE INDEX idx_project_webhook_unique_resource_id ON project_webhook(resource_id);```-### Code Changes+**Phase 2: Switch store/API layer to use `resource_id`**++Migrate tables in dependency order -- leaf tables first, root tables last.++*Group A -- Standalone tables (no FK dependents):*+- `revision`, `changelog`, `project_webhook`, `issue_comment`+- Simplest to migrate: change message struct, SQL queries, and resource name parsers.++*Group B -- Tables with FK dependents:*+- `worksheet` (depended on by `worksheet_organizer.worksheet_id`)+- `task_run` (depended on by `task_run_log.task_run_id`)+- `task` (depended on by `task_run.task_id`)+- `issue` (depended on by `issue_comment.issue_id`)++*Group C -- Root table:*+- `plan` (depended on by `task.plan_id`, `issue.plan_id`, `plan_check_run.plan_id`, `plan_webhook_delivery.plan_id`)++For each table:+1. Change message struct field from `UID int`/`ID int` to `ResourceID string`+2. Update SQL: `SELECT resource_id` instead of `SELECT id`, `WHERE resource_id = $1` instead of `WHERE id = $1`, `RETURNING resource_id` instead of `RETURNING id`+3. Update `resource_name.go` parsing functions to return `string` instead of `int`/`int64`. Remove `strconv.Atoi()`/`strconv.ParseInt()` calls.+4. Update all callsites that use the parsed ID-- **Store files**: Remove `id` from SELECT lists, INSERT RETURNING clauses, and message struct fields where applicable.-- **ORDER BY id**: Replace with `ORDER BY created_at` (for `idp`, `task_run_log`, `release`) or `ORDER BY resource_id` where appropriate.-- **release.go**: Remove the `var id int64` scan from the RETURNING clause.-- **Migration test**: Update `TestLatestVersion` in `backend/migrator/migrator_test.go`.+**Phase 3: Migrate FK columns from integer to string**++After each table's own `resource_id` is live, update FK columns in dependent tables to reference the new string column. This requires a SQL migration per FK:++| FK column | Current reference | New reference |+|-----------|------------------|--------------|+| `task.plan_id` | `bigint → plan(id)` | `text → plan(resource_id)` |+| `issue.plan_id` | `bigint → plan(id)` | `text → plan(resource_id)` |+| `plan_check_run.plan_id` | `bigint → plan(id)` | `text → plan(resource_id)` |+| `plan_webhook_delivery.plan_id` | `bigint → plan(id)` | `text → plan(resource_id)` |+| `task_run.task_id` | `int → task(id)` | `text → task(resource_id)` |+| `task_run_log.task_run_id` | `int → task_run(id)` | `text → task_run(resource_id)` |+| `issue_comment.issue_id` | `int → issue(id)` | `text → issue(resource_id)` |+| `worksheet_organizer.worksheet_id` | `int → worksheet(id)` | `text → worksheet(resource_id)` |+| `changelog.sync_history_id` | `bigint → sync_history(id)` | Keep as-is (internal) |++Note: `task_run` has `UNIQUE(task_id, attempt)` -- this constraint must be recreated with the new text `task_id`.++**Phase 4: Migrate JSONB/proto fields storing integer IDs**++| Proto field | Change | Data migration |+|------------|--------|---------------|+| `AccessGrantPayload.issue_id` | `int64` → `string` | Update `access_grant.payload` JSONB: convert `issueId` integer to `issue.resource_id` string |+| `TaskRunResult.export_archive_uid` | `int32` → `string` | Update `task_run.result` JSONB: convert `exportArchiveUid` to string |+| `Signal.uid` | `int32` → `string` | Update PG NOTIFY signal format (transient, no data migration) |++**Phase 5: Drop old integer `id` columns and promote `resource_id` to PK**++After all FK references are migrated, drop the old integer `id` columns from the 9 API-exposed tables.++### Risks & Considerations++1. **Massive changeset** -- Touches virtually every store file, every API service file, and every resource name parsing function. Must be split into multiple PRs.+2. **FK chain depth** -- `plan → task → task_run → task_run_log` is 4 levels deep. Must migrate bottom-up.+3. **Unique constraint** -- `task_run` has `UNIQUE(task_id, attempt)` that needs recreating when `task_id` becomes text.+4. **`plan_check_run`** is a singleton per plan (unique on `plan_id`) -- also needs FK migration.+5. **Backward compatibility** -- Existing URLs with integer IDs in bookmarks/webhooks will break. Consider keeping integer-to-resource_id lookup during a transition period.+6. **Frontend** -- No change needed (the frontend already treats resource IDs as opaque strings in URL paths).+7. **Proto** -- No v1 API proto change needed (resource names are already strings).++### Recommended PR Split++| PR | Scope | Description |+|----|-------|-------------|+| 0 | Phase 0 | Drop unused `id` columns from 11 tables, promote natural keys to PK |+| 1 | Phase 1 | Add `resource_id` columns + unique indexes to all 9 API-exposed tables |+| 2 | Phase 2 Group A | `revision`, `changelog`, `project_webhook`, `issue_comment` -- store/API switch to `resource_id` |+| 3 | Phase 2 `worksheet` | Store/API switch + `worksheet_organizer` FK migration |+| 4 | Phase 2 `issue` | Store/API switch + `issue_comment.issue_id` FK migration |+| 5 | Phase 2 `task_run` | Store/API switch + `task_run_log.task_run_id` FK migration |+| 6 | Phase 2 `task` | Store/API switch + `task_run.task_id` FK migration (recreate UNIQUE constraint) |+| 7 | Phase 2 `plan` | Store/API switch + all plan FK dependents (`task`, `issue`, `plan_check_run`, `plan_webhook_delivery`) |+| 8 | Phase 3-5 | FK column migrations, JSONB/proto field migrations, drop old `id` columns |++### Internal-Only Tables++The 4 tables with internal-only integer IDs (`sync_history`, `query_history`, `export_archive`, `worksheet_organizer`) can keep integer IDs since they are never exposed in API paths. However, for consistency, consider migrating them in a follow-up.