@team-semicolon/semicolony-cli 4.18.74 → 4.18.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- Migration 181 made source_repository nullable for DB-native common-skill
|
|
2
|
+
-- releases, but migration 161 also created a separate non-empty CHECK. A
|
|
3
|
+
-- PostgreSQL CHECK containing `IS NOT NULL` rejects the intended NULL even
|
|
4
|
+
-- after the column-level NOT NULL constraint is removed.
|
|
5
|
+
--
|
|
6
|
+
-- The composite skill_releases_provenance_check remains authoritative: it
|
|
7
|
+
-- requires NULL Git provenance for source_kind='db' and non-empty repository
|
|
8
|
+
-- provenance for source_kind='git-legacy'. Hash format checks remain in place;
|
|
9
|
+
-- they naturally accept NULL for DB-native rows and validate legacy values.
|
|
10
|
+
|
|
11
|
+
ALTER TABLE semicolony.skill_releases
|
|
12
|
+
DROP CONSTRAINT IF EXISTS skill_releases_source_repository_check;
|
|
13
|
+
|
|
14
|
+
COMMENT ON CONSTRAINT skill_releases_provenance_check
|
|
15
|
+
ON semicolony.skill_releases IS
|
|
16
|
+
'Source-specific provenance contract: DB releases have task/base lineage; legacy releases retain complete Git lineage.';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
-- 183_db_native_skill_release_constraints.sql
|
|
2
|
+
--
|
|
3
|
+
-- Migration 181 made Git provenance nullable for DB-native authoring, but the
|
|
4
|
+
-- inline checks created by migration 161 still reject NULL before the new
|
|
5
|
+
-- source-kind provenance check can accept it. Replace those legacy checks with
|
|
6
|
+
-- nullable format checks; skill_releases_provenance_check continues to require
|
|
7
|
+
-- all three values for git-legacy rows.
|
|
8
|
+
|
|
9
|
+
ALTER TABLE semicolony.skill_releases
|
|
10
|
+
DROP CONSTRAINT IF EXISTS skill_releases_source_repository_check,
|
|
11
|
+
DROP CONSTRAINT IF EXISTS skill_releases_git_commit_sha_check,
|
|
12
|
+
DROP CONSTRAINT IF EXISTS skill_releases_git_tree_oid_check;
|
|
13
|
+
|
|
14
|
+
ALTER TABLE semicolony.skill_releases
|
|
15
|
+
ADD CONSTRAINT skill_releases_source_repository_format_check
|
|
16
|
+
CHECK (
|
|
17
|
+
source_repository IS NULL
|
|
18
|
+
OR NULLIF(btrim(source_repository), '') IS NOT NULL
|
|
19
|
+
),
|
|
20
|
+
ADD CONSTRAINT skill_releases_git_commit_sha_format_check
|
|
21
|
+
CHECK (
|
|
22
|
+
git_commit_sha IS NULL
|
|
23
|
+
OR git_commit_sha ~ '^[0-9a-f]{40}$'
|
|
24
|
+
),
|
|
25
|
+
ADD CONSTRAINT skill_releases_git_tree_oid_format_check
|
|
26
|
+
CHECK (
|
|
27
|
+
git_tree_oid IS NULL
|
|
28
|
+
OR git_tree_oid ~ '^[0-9a-f]{40}$'
|
|
29
|
+
);
|
|
30
|
+
|