Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: use NOT NULL for inherit_from_parent (#3568)

Danny Xu4b5826e0d926
diff --git a/store/migration/dev/LATEST.sql b/store/migration/dev/LATEST.sql
index fa8d64b150..39c707e5c8 100644
--- a/store/migration/dev/LATEST.sql
+++ b/store/migration/dev/LATEST.sql
@@ -141,7 +141,7 @@ CREATE TABLE policy (
payload JSONB NOT NULL DEFAULT '{}',
resource_type resource_type NOT NULL,
resource_id INTEGER NOT NULL,
- inherit_from_parent BOOLEAN DEFAULT TRUE
+ inherit_from_parent BOOLEAN NOT NULL DEFAULT TRUE
);
CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_id_type ON policy(resource_type, resource_id, type);
diff --git a/store/migration/prod/1.9/0000##flexible_policy.sql b/store/migration/prod/1.9/0000##flexible_policy.sql
index 6320c7a190..4e5c0dbae2 100644
--- a/store/migration/prod/1.9/0000##flexible_policy.sql
+++ b/store/migration/prod/1.9/0000##flexible_policy.sql
@@ -5,7 +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 ADD COLUMN inherit_from_parent BOOLEAN NOT NULL 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/prod/LATEST.sql b/store/migration/prod/LATEST.sql
index 1518b2c1b1..9c2916501e 100644
--- a/store/migration/prod/LATEST.sql
+++ b/store/migration/prod/LATEST.sql
@@ -141,7 +141,7 @@ CREATE TABLE policy (
payload JSONB NOT NULL DEFAULT '{}',
resource_type resource_type NOT NULL,
resource_id INTEGER NOT NULL,
- inherit_from_parent BOOLEAN DEFAULT TRUE
+ inherit_from_parent BOOLEAN NOT NULL DEFAULT TRUE
);
CREATE UNIQUE INDEX idx_policy_unique_resource_type_resource_id_type ON policy(resource_type, resource_id, type);