Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: introduce inherit_from_parent column in policy (#3474)
Danny Xu4a991e5c07e7
diff --git a/store/migration/dev/20221118000000##flexible_policy.sql b/store/migration/dev/20221118000000##flexible_policy.sqlindex d945d81fd6..6320c7a190 100644--- a/store/migration/dev/20221118000000##flexible_policy.sql+++ b/store/migration/dev/20221118000000##flexible_policy.sql@@ -5,6 +5,7 @@ DROP INDEX idx_policy_unique_environment_id_type;ALTER TABLE policy ADD COLUMN resource_type resource_type;ALTER TABLE policy ADD COLUMN resource_id INTEGER;+ALTER TABLE policy ADD COLUMN inherit_from_parent BOOLEAN DEFAULT TRUE;ALTER TABLE policy DROP CONSTRAINT policy_environment_id_fkey;UPDATE policy SET resource_type='ENVIRONMENT', resource_id=environment_id;diff --git a/store/migration/dev/LATEST.sql b/store/migration/dev/LATEST.sqlindex a4669a0bd1..66d7186561 100644--- a/store/migration/dev/LATEST.sql+++ b/store/migration/dev/LATEST.sql@@ -140,7 +140,8 @@ CREATE TABLE policy (type TEXT NOT NULL CHECK (type LIKE 'bb.policy.%'),payload JSONB NOT NULL DEFAULT '{}',resource_type resource_type NOT NULL,- resource_id INTEGER NOT NULL+ resource_id INTEGER NOT NULL,+ inherit_from_parent BOOLEAN DEFAULT TRUE);CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_id_type ON policy(resource_type, resource_id, type);