@shepai/cli 1.111.0 → 1.112.0
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.
- package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.d.ts +27 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.js +540 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.d.ts +13 -7
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.js +94 -545
- package/dist/packages/core/src/infrastructure/persistence/sqlite/sqlite-migration-storage.d.ts +59 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/sqlite-migration-storage.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/sqlite-migration-storage.js +98 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_2649c1af._.js → _5214cc6d._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_2649c1af._.js.map → _5214cc6d._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_4474f9f3._.js → _688c410c._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_4474f9f3._.js.map → _688c410c._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_ba9c581b._.js → _8ef2db1a._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ba9c581b._.js.map → _8ef2db1a._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +31 -31
- package/web/.next/static/chunks/{b27c0bbd1de96d37.js → 2ceb08e50a58ff13.js} +1 -1
- package/web/.next/static/chunks/{cbfa943160cc5f90.js → 3a154a226e936a39.js} +1 -1
- package/web/.next/static/chunks/{279db4719a31b985.js → 691c8fb9987506c7.js} +1 -1
- package/web/.next/static/chunks/{185203c3444a4da7.js → 6a91f6e4059b8e65.js} +2 -2
- package/web/.next/static/chunks/{5f52d11e6182396e.js → 6e5ddc3f058e4c15.js} +1 -1
- package/web/.next/static/chunks/{487babfd13611736.js → 974a4718eae26449.js} +1 -1
- package/web/.next/static/chunks/{4e2530a36f28dec7.js → 979328ec65bd195c.js} +2 -2
- package/web/.next/static/chunks/{dd15e70af64f5dd0.js → a067d472cd7bab74.js} +1 -1
- package/web/.next/static/chunks/c2c5d4e54fb6693a.js +1 -0
- package/web/.next/static/chunks/cf78337357d8447e.js +1 -0
- package/web/.next/static/chunks/464557a2dc1fe286.js +0 -1
- package/web/.next/static/chunks/6d2a5b3e881c75a8.js +0 -1
- /package/web/.next/static/{4LIlcvj7VQahrcSQtqQlm → m4kJ9xcvKM_tYBQYtX8sa}/_buildManifest.js +0 -0
- /package/web/.next/static/{4LIlcvj7VQahrcSQtqQlm → m4kJ9xcvKM_tYBQYtX8sa}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{4LIlcvj7VQahrcSQtqQlm → m4kJ9xcvKM_tYBQYtX8sa}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Migration Definitions (V1–V34)
|
|
3
|
+
*
|
|
4
|
+
* Registers the 34 existing migrations as umzug-compatible RunnableMigration objects.
|
|
5
|
+
* Each migration preserves the exact SQL and/or handler logic from the original
|
|
6
|
+
* migrations.ts, wrapped in a transaction that also sets PRAGMA user_version.
|
|
7
|
+
*
|
|
8
|
+
* Legacy migrations are kept inline in a single module because:
|
|
9
|
+
* 1. Avoids 34-file churn for frozen history
|
|
10
|
+
* 2. Handles the 7 handler-based migrations (V20–V31) naturally
|
|
11
|
+
* 3. Survives tsc compilation (inline SQL, no .sql files)
|
|
12
|
+
*
|
|
13
|
+
* New migrations (35+) are individual .ts files in the migrations/ directory.
|
|
14
|
+
*/
|
|
15
|
+
import type Database from 'better-sqlite3';
|
|
16
|
+
import type { RunnableMigration } from 'umzug';
|
|
17
|
+
/**
|
|
18
|
+
* All 34 legacy migrations as umzug-compatible RunnableMigration objects.
|
|
19
|
+
* Ordered by version number (001–034) for deterministic execution.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LEGACY_MIGRATIONS: RunnableMigration<Database.Database>[];
|
|
22
|
+
/**
|
|
23
|
+
* Ordered list of legacy migration names for use with the bootstrap seeder.
|
|
24
|
+
* E.g., ['001-create-settings-table', '002-add-agent-config', ...]
|
|
25
|
+
*/
|
|
26
|
+
export declare const LEGACY_MIGRATION_NAMES: string[];
|
|
27
|
+
//# sourceMappingURL=legacy-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-migrations.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/persistence/sqlite/legacy-migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAwhBhE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAC3B,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAAsC,CAAC"}
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Migration Definitions (V1–V34)
|
|
3
|
+
*
|
|
4
|
+
* Registers the 34 existing migrations as umzug-compatible RunnableMigration objects.
|
|
5
|
+
* Each migration preserves the exact SQL and/or handler logic from the original
|
|
6
|
+
* migrations.ts, wrapped in a transaction that also sets PRAGMA user_version.
|
|
7
|
+
*
|
|
8
|
+
* Legacy migrations are kept inline in a single module because:
|
|
9
|
+
* 1. Avoids 34-file churn for frozen history
|
|
10
|
+
* 2. Handles the 7 handler-based migrations (V20–V31) naturally
|
|
11
|
+
* 3. Survives tsc compilation (inline SQL, no .sql files)
|
|
12
|
+
*
|
|
13
|
+
* New migrations (35+) are individual .ts files in the migrations/ directory.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The 34 legacy migration definitions with descriptive names and SQL/handler logic.
|
|
17
|
+
*/
|
|
18
|
+
const MIGRATION_DEFS = [
|
|
19
|
+
{
|
|
20
|
+
version: 1,
|
|
21
|
+
name: '001-create-settings-table',
|
|
22
|
+
sql: `
|
|
23
|
+
CREATE TABLE IF NOT EXISTS settings (
|
|
24
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
25
|
+
created_at TEXT NOT NULL,
|
|
26
|
+
updated_at TEXT NOT NULL,
|
|
27
|
+
model_analyze TEXT NOT NULL,
|
|
28
|
+
model_requirements TEXT NOT NULL,
|
|
29
|
+
model_plan TEXT NOT NULL,
|
|
30
|
+
model_implement TEXT NOT NULL,
|
|
31
|
+
user_name TEXT,
|
|
32
|
+
user_email TEXT,
|
|
33
|
+
user_github_username TEXT,
|
|
34
|
+
env_default_editor TEXT NOT NULL,
|
|
35
|
+
env_shell_preference TEXT NOT NULL,
|
|
36
|
+
sys_auto_update INTEGER NOT NULL,
|
|
37
|
+
sys_log_level TEXT NOT NULL
|
|
38
|
+
);
|
|
39
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_settings_id ON settings(id);
|
|
40
|
+
`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
version: 2,
|
|
44
|
+
name: '002-add-agent-config',
|
|
45
|
+
sql: `
|
|
46
|
+
ALTER TABLE settings ADD COLUMN agent_type TEXT NOT NULL DEFAULT 'claude-code';
|
|
47
|
+
ALTER TABLE settings ADD COLUMN agent_auth_method TEXT NOT NULL DEFAULT 'session';
|
|
48
|
+
ALTER TABLE settings ADD COLUMN agent_token TEXT;
|
|
49
|
+
`,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
version: 3,
|
|
53
|
+
name: '003-create-agent-runs',
|
|
54
|
+
sql: `
|
|
55
|
+
CREATE TABLE agent_runs (
|
|
56
|
+
id TEXT PRIMARY KEY,
|
|
57
|
+
agent_type TEXT NOT NULL,
|
|
58
|
+
agent_name TEXT NOT NULL,
|
|
59
|
+
status TEXT NOT NULL,
|
|
60
|
+
prompt TEXT NOT NULL,
|
|
61
|
+
result TEXT,
|
|
62
|
+
session_id TEXT,
|
|
63
|
+
thread_id TEXT NOT NULL,
|
|
64
|
+
pid INTEGER,
|
|
65
|
+
last_heartbeat INTEGER,
|
|
66
|
+
started_at INTEGER,
|
|
67
|
+
completed_at INTEGER,
|
|
68
|
+
error TEXT,
|
|
69
|
+
created_at INTEGER NOT NULL,
|
|
70
|
+
updated_at INTEGER NOT NULL
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
CREATE INDEX idx_agent_runs_status ON agent_runs(status);
|
|
74
|
+
CREATE INDEX idx_agent_runs_pid ON agent_runs(pid) WHERE pid IS NOT NULL;
|
|
75
|
+
CREATE INDEX idx_agent_runs_thread_id ON agent_runs(thread_id);
|
|
76
|
+
`,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
version: 4,
|
|
80
|
+
name: '004-create-features',
|
|
81
|
+
sql: `
|
|
82
|
+
CREATE TABLE features (
|
|
83
|
+
id TEXT PRIMARY KEY,
|
|
84
|
+
name TEXT NOT NULL,
|
|
85
|
+
slug TEXT NOT NULL,
|
|
86
|
+
description TEXT NOT NULL,
|
|
87
|
+
repository_path TEXT NOT NULL,
|
|
88
|
+
branch TEXT NOT NULL,
|
|
89
|
+
lifecycle TEXT NOT NULL DEFAULT 'Requirements',
|
|
90
|
+
messages TEXT NOT NULL DEFAULT '[]',
|
|
91
|
+
plan TEXT,
|
|
92
|
+
related_artifacts TEXT NOT NULL DEFAULT '[]',
|
|
93
|
+
agent_run_id TEXT,
|
|
94
|
+
created_at INTEGER NOT NULL,
|
|
95
|
+
updated_at INTEGER NOT NULL
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
CREATE INDEX idx_features_slug ON features(slug, repository_path);
|
|
99
|
+
CREATE INDEX idx_features_repo ON features(repository_path);
|
|
100
|
+
CREATE INDEX idx_features_lifecycle ON features(lifecycle);
|
|
101
|
+
`,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
version: 5,
|
|
105
|
+
name: '005-add-feature-refs-to-agent-runs',
|
|
106
|
+
sql: `
|
|
107
|
+
ALTER TABLE agent_runs ADD COLUMN feature_id TEXT;
|
|
108
|
+
ALTER TABLE agent_runs ADD COLUMN repository_path TEXT;
|
|
109
|
+
CREATE INDEX idx_agent_runs_feature ON agent_runs(feature_id) WHERE feature_id IS NOT NULL;
|
|
110
|
+
`,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
version: 6,
|
|
114
|
+
name: '006-add-approval-workflow',
|
|
115
|
+
sql: `
|
|
116
|
+
ALTER TABLE agent_runs ADD COLUMN approval_mode TEXT;
|
|
117
|
+
ALTER TABLE agent_runs ADD COLUMN approval_status TEXT;
|
|
118
|
+
`,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
version: 7,
|
|
122
|
+
name: '007-add-spec-path',
|
|
123
|
+
sql: `
|
|
124
|
+
ALTER TABLE features ADD COLUMN spec_path TEXT;
|
|
125
|
+
`,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
version: 8,
|
|
129
|
+
name: '008-add-approval-gates-and-phase-timings',
|
|
130
|
+
sql: `
|
|
131
|
+
ALTER TABLE agent_runs ADD COLUMN approval_gates TEXT;
|
|
132
|
+
|
|
133
|
+
UPDATE agent_runs SET approval_gates = '{"allowPrd":true,"allowPlan":false}'
|
|
134
|
+
WHERE approval_mode = 'allow-prd';
|
|
135
|
+
UPDATE agent_runs SET approval_gates = '{"allowPrd":false,"allowPlan":true}'
|
|
136
|
+
WHERE approval_mode = 'allow-plan';
|
|
137
|
+
UPDATE agent_runs SET approval_gates = '{"allowPrd":true,"allowPlan":true}'
|
|
138
|
+
WHERE approval_mode = 'allow-all';
|
|
139
|
+
UPDATE agent_runs SET approval_gates = '{"allowPrd":false,"allowPlan":false}'
|
|
140
|
+
WHERE approval_mode = 'interactive';
|
|
141
|
+
|
|
142
|
+
CREATE TABLE phase_timings (
|
|
143
|
+
id TEXT PRIMARY KEY,
|
|
144
|
+
agent_run_id TEXT NOT NULL,
|
|
145
|
+
phase TEXT NOT NULL,
|
|
146
|
+
started_at INTEGER NOT NULL,
|
|
147
|
+
completed_at INTEGER,
|
|
148
|
+
duration_ms INTEGER,
|
|
149
|
+
created_at INTEGER NOT NULL,
|
|
150
|
+
updated_at INTEGER NOT NULL
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
CREATE INDEX idx_phase_timings_run ON phase_timings(agent_run_id);
|
|
154
|
+
`,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
version: 9,
|
|
158
|
+
name: '009-add-notification-preferences',
|
|
159
|
+
sql: `
|
|
160
|
+
ALTER TABLE settings ADD COLUMN notif_in_app_enabled INTEGER NOT NULL DEFAULT 1;
|
|
161
|
+
ALTER TABLE settings ADD COLUMN notif_browser_enabled INTEGER NOT NULL DEFAULT 1;
|
|
162
|
+
ALTER TABLE settings ADD COLUMN notif_desktop_enabled INTEGER NOT NULL DEFAULT 1;
|
|
163
|
+
ALTER TABLE settings ADD COLUMN notif_evt_agent_started INTEGER NOT NULL DEFAULT 1;
|
|
164
|
+
ALTER TABLE settings ADD COLUMN notif_evt_phase_completed INTEGER NOT NULL DEFAULT 1;
|
|
165
|
+
ALTER TABLE settings ADD COLUMN notif_evt_waiting_approval INTEGER NOT NULL DEFAULT 1;
|
|
166
|
+
ALTER TABLE settings ADD COLUMN notif_evt_agent_completed INTEGER NOT NULL DEFAULT 1;
|
|
167
|
+
ALTER TABLE settings ADD COLUMN notif_evt_agent_failed INTEGER NOT NULL DEFAULT 1;
|
|
168
|
+
`,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
version: 10,
|
|
172
|
+
name: '010-add-workflow-flags-and-pr-tracking',
|
|
173
|
+
sql: `
|
|
174
|
+
ALTER TABLE features ADD COLUMN open_pr INTEGER NOT NULL DEFAULT 0;
|
|
175
|
+
ALTER TABLE features ADD COLUMN auto_merge INTEGER NOT NULL DEFAULT 0;
|
|
176
|
+
ALTER TABLE features ADD COLUMN allow_prd INTEGER NOT NULL DEFAULT 0;
|
|
177
|
+
ALTER TABLE features ADD COLUMN allow_plan INTEGER NOT NULL DEFAULT 0;
|
|
178
|
+
ALTER TABLE features ADD COLUMN allow_merge INTEGER NOT NULL DEFAULT 0;
|
|
179
|
+
|
|
180
|
+
ALTER TABLE features ADD COLUMN pr_url TEXT;
|
|
181
|
+
ALTER TABLE features ADD COLUMN pr_number INTEGER;
|
|
182
|
+
ALTER TABLE features ADD COLUMN pr_status TEXT;
|
|
183
|
+
ALTER TABLE features ADD COLUMN commit_hash TEXT;
|
|
184
|
+
ALTER TABLE features ADD COLUMN ci_status TEXT;
|
|
185
|
+
|
|
186
|
+
ALTER TABLE settings ADD COLUMN workflow_open_pr_on_impl_complete INTEGER NOT NULL DEFAULT 0;
|
|
187
|
+
ALTER TABLE settings ADD COLUMN workflow_auto_merge_on_impl_complete INTEGER NOT NULL DEFAULT 0;
|
|
188
|
+
|
|
189
|
+
UPDATE features SET lifecycle = 'Maintain' WHERE lifecycle = 'Deploy & QA';
|
|
190
|
+
`,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
version: 11,
|
|
194
|
+
name: '011-add-worktree-path',
|
|
195
|
+
sql: `
|
|
196
|
+
ALTER TABLE features ADD COLUMN worktree_path TEXT;
|
|
197
|
+
`,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
version: 12,
|
|
201
|
+
name: '012-add-push-column',
|
|
202
|
+
sql: `
|
|
203
|
+
ALTER TABLE features ADD COLUMN push INTEGER NOT NULL DEFAULT 0;
|
|
204
|
+
`,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
version: 13,
|
|
208
|
+
name: '013-add-user-query',
|
|
209
|
+
sql: `
|
|
210
|
+
ALTER TABLE features ADD COLUMN user_query TEXT NOT NULL DEFAULT '';
|
|
211
|
+
`,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
version: 14,
|
|
215
|
+
name: '014-add-approval-wait-timing',
|
|
216
|
+
sql: `
|
|
217
|
+
ALTER TABLE phase_timings ADD COLUMN waiting_approval_at INTEGER;
|
|
218
|
+
ALTER TABLE phase_timings ADD COLUMN approval_wait_ms INTEGER;
|
|
219
|
+
`,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
version: 15,
|
|
223
|
+
name: '015-create-repositories-and-backfill',
|
|
224
|
+
sql: `
|
|
225
|
+
CREATE TABLE repositories (
|
|
226
|
+
id TEXT PRIMARY KEY,
|
|
227
|
+
name TEXT NOT NULL,
|
|
228
|
+
path TEXT NOT NULL UNIQUE,
|
|
229
|
+
created_at INTEGER NOT NULL,
|
|
230
|
+
updated_at INTEGER NOT NULL
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
CREATE INDEX idx_repositories_path ON repositories(path);
|
|
234
|
+
|
|
235
|
+
INSERT INTO repositories (id, name, path, created_at, updated_at)
|
|
236
|
+
SELECT
|
|
237
|
+
lower(hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-4' || substr(hex(randomblob(2)),2) || '-' || substr('89ab', abs(random()) % 4 + 1, 1) || substr(hex(randomblob(2)),2) || '-' || hex(randomblob(6))) AS id,
|
|
238
|
+
CASE
|
|
239
|
+
WHEN instr(repository_path, '/') > 0
|
|
240
|
+
THEN replace(repository_path, rtrim(repository_path, replace(repository_path, '/', '')), '')
|
|
241
|
+
ELSE repository_path
|
|
242
|
+
END AS name,
|
|
243
|
+
repository_path AS path,
|
|
244
|
+
MIN(created_at) AS created_at,
|
|
245
|
+
MAX(updated_at) AS updated_at
|
|
246
|
+
FROM features
|
|
247
|
+
WHERE repository_path IS NOT NULL AND repository_path != ''
|
|
248
|
+
GROUP BY repository_path;
|
|
249
|
+
|
|
250
|
+
ALTER TABLE features ADD COLUMN repository_id TEXT;
|
|
251
|
+
|
|
252
|
+
UPDATE features SET repository_id = (
|
|
253
|
+
SELECT r.id FROM repositories r WHERE r.path = features.repository_path
|
|
254
|
+
);
|
|
255
|
+
`,
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
version: 16,
|
|
259
|
+
name: '016-add-repository-soft-delete',
|
|
260
|
+
sql: `
|
|
261
|
+
ALTER TABLE repositories ADD COLUMN deleted_at INTEGER;
|
|
262
|
+
`,
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
version: 17,
|
|
266
|
+
name: '017-fix-repository-names',
|
|
267
|
+
sql: `
|
|
268
|
+
UPDATE repositories
|
|
269
|
+
SET name = replace(path, rtrim(path, replace(path, '/', '')), '')
|
|
270
|
+
WHERE instr(path, '/') > 0;
|
|
271
|
+
`,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
version: 18,
|
|
275
|
+
name: '018-add-onboarding-and-approval-defaults',
|
|
276
|
+
sql: `
|
|
277
|
+
ALTER TABLE settings ADD COLUMN onboarding_complete INTEGER NOT NULL DEFAULT 0;
|
|
278
|
+
ALTER TABLE settings ADD COLUMN approval_gate_allow_prd INTEGER NOT NULL DEFAULT 0;
|
|
279
|
+
ALTER TABLE settings ADD COLUMN approval_gate_allow_plan INTEGER NOT NULL DEFAULT 0;
|
|
280
|
+
ALTER TABLE settings ADD COLUMN approval_gate_allow_merge INTEGER NOT NULL DEFAULT 0;
|
|
281
|
+
ALTER TABLE settings ADD COLUMN approval_gate_push_on_impl_complete INTEGER NOT NULL DEFAULT 0;
|
|
282
|
+
|
|
283
|
+
UPDATE settings SET onboarding_complete = 1 WHERE id IS NOT NULL;
|
|
284
|
+
`,
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
version: 19,
|
|
288
|
+
name: '019-add-ci-fix-tracking',
|
|
289
|
+
sql: `
|
|
290
|
+
ALTER TABLE features ADD COLUMN ci_fix_attempts INTEGER;
|
|
291
|
+
ALTER TABLE features ADD COLUMN ci_fix_history TEXT;
|
|
292
|
+
`,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
version: 20,
|
|
296
|
+
name: '020-add-parent-id-and-backfill-ci-fix',
|
|
297
|
+
sql: '',
|
|
298
|
+
handler: (db) => {
|
|
299
|
+
const columns = db.pragma('table_info(features)');
|
|
300
|
+
if (!columns.some((c) => c.name === 'ci_fix_attempts')) {
|
|
301
|
+
db.exec('ALTER TABLE features ADD COLUMN ci_fix_attempts INTEGER');
|
|
302
|
+
}
|
|
303
|
+
if (!columns.some((c) => c.name === 'ci_fix_history')) {
|
|
304
|
+
db.exec('ALTER TABLE features ADD COLUMN ci_fix_history TEXT');
|
|
305
|
+
}
|
|
306
|
+
if (!columns.some((c) => c.name === 'parent_id')) {
|
|
307
|
+
db.exec('ALTER TABLE features ADD COLUMN parent_id TEXT');
|
|
308
|
+
}
|
|
309
|
+
db.exec('CREATE INDEX IF NOT EXISTS idx_features_parent_id ON features(parent_id)');
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
version: 21,
|
|
314
|
+
name: '021-backfill-ci-fix-columns',
|
|
315
|
+
sql: '',
|
|
316
|
+
handler: (db) => {
|
|
317
|
+
const columns = db.pragma('table_info(features)');
|
|
318
|
+
if (!columns.some((c) => c.name === 'ci_fix_attempts')) {
|
|
319
|
+
db.exec('ALTER TABLE features ADD COLUMN ci_fix_attempts INTEGER');
|
|
320
|
+
}
|
|
321
|
+
if (!columns.some((c) => c.name === 'ci_fix_history')) {
|
|
322
|
+
db.exec('ALTER TABLE features ADD COLUMN ci_fix_history TEXT');
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
version: 22,
|
|
328
|
+
name: '022-add-pr-notification-filters',
|
|
329
|
+
sql: '',
|
|
330
|
+
handler: (db) => {
|
|
331
|
+
const columns = db.pragma('table_info(settings)');
|
|
332
|
+
const add = (col) => {
|
|
333
|
+
if (!columns.some((c) => c.name === col)) {
|
|
334
|
+
db.exec(`ALTER TABLE settings ADD COLUMN ${col} INTEGER NOT NULL DEFAULT 1`);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
add('notif_evt_pr_merged');
|
|
338
|
+
add('notif_evt_pr_closed');
|
|
339
|
+
add('notif_evt_pr_checks_passed');
|
|
340
|
+
add('notif_evt_pr_checks_failed');
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
version: 23,
|
|
345
|
+
name: '023-backfill-orphaned-repositories',
|
|
346
|
+
sql: `
|
|
347
|
+
INSERT OR IGNORE INTO repositories (id, name, path, created_at, updated_at)
|
|
348
|
+
SELECT
|
|
349
|
+
lower(hex(randomblob(16))) AS id,
|
|
350
|
+
CASE
|
|
351
|
+
WHEN instr(repository_path, '/') > 0
|
|
352
|
+
THEN replace(repository_path, rtrim(repository_path, replace(repository_path, '/', '')), '')
|
|
353
|
+
ELSE repository_path
|
|
354
|
+
END AS name,
|
|
355
|
+
repository_path AS path,
|
|
356
|
+
strftime('%s', 'now') * 1000 AS created_at,
|
|
357
|
+
strftime('%s', 'now') * 1000 AS updated_at
|
|
358
|
+
FROM (
|
|
359
|
+
SELECT DISTINCT repository_path
|
|
360
|
+
FROM features
|
|
361
|
+
WHERE repository_path IS NOT NULL AND repository_path != ''
|
|
362
|
+
)
|
|
363
|
+
WHERE repository_path NOT IN (SELECT path FROM repositories WHERE path IS NOT NULL);
|
|
364
|
+
`,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
version: 24,
|
|
368
|
+
name: '024-add-feature-flags-and-ci-workflow',
|
|
369
|
+
sql: '',
|
|
370
|
+
handler: (db) => {
|
|
371
|
+
const columns = db.pragma('table_info(settings)');
|
|
372
|
+
const addNotNull = (col, dflt) => {
|
|
373
|
+
if (!columns.some((c) => c.name === col)) {
|
|
374
|
+
db.exec(`ALTER TABLE settings ADD COLUMN ${col} INTEGER NOT NULL DEFAULT ${dflt}`);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
const addNullable = (col) => {
|
|
378
|
+
if (!columns.some((c) => c.name === col)) {
|
|
379
|
+
db.exec(`ALTER TABLE settings ADD COLUMN ${col} INTEGER`);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
addNotNull('feature_flag_skills', '0');
|
|
383
|
+
addNotNull('feature_flag_env_deploy', '1');
|
|
384
|
+
addNotNull('feature_flag_debug', '0');
|
|
385
|
+
addNullable('ci_max_fix_attempts');
|
|
386
|
+
addNullable('ci_watch_timeout_ms');
|
|
387
|
+
addNullable('ci_log_max_chars');
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
version: 25,
|
|
392
|
+
name: '025-add-model-default',
|
|
393
|
+
sql: '',
|
|
394
|
+
handler: (db) => {
|
|
395
|
+
const settingsCols = db.pragma('table_info(settings)');
|
|
396
|
+
if (!settingsCols.some((c) => c.name === 'model_default')) {
|
|
397
|
+
db.exec("ALTER TABLE settings ADD COLUMN model_default TEXT NOT NULL DEFAULT 'claude-sonnet-4-6'");
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
version: 26,
|
|
403
|
+
name: '026-add-model-id-to-agent-runs',
|
|
404
|
+
sql: '',
|
|
405
|
+
handler: (db) => {
|
|
406
|
+
const columns = db.pragma('table_info(agent_runs)');
|
|
407
|
+
if (!columns.some((c) => c.name === 'model_id')) {
|
|
408
|
+
db.exec('ALTER TABLE agent_runs ADD COLUMN model_id TEXT');
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
version: 27,
|
|
414
|
+
name: '027-add-fast-column',
|
|
415
|
+
sql: '',
|
|
416
|
+
handler: (db) => {
|
|
417
|
+
const columns = db.pragma('table_info(features)');
|
|
418
|
+
if (!columns.some((c) => c.name === 'fast')) {
|
|
419
|
+
db.exec('ALTER TABLE features ADD COLUMN fast INTEGER NOT NULL DEFAULT 0');
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
version: 28,
|
|
425
|
+
name: '028-add-attachments',
|
|
426
|
+
sql: '',
|
|
427
|
+
handler: (db) => {
|
|
428
|
+
const columns = db.pragma('table_info(features)');
|
|
429
|
+
if (!columns.some((c) => c.name === 'fast')) {
|
|
430
|
+
db.exec('ALTER TABLE features ADD COLUMN fast INTEGER NOT NULL DEFAULT 0');
|
|
431
|
+
}
|
|
432
|
+
if (!columns.some((c) => c.name === 'attachments')) {
|
|
433
|
+
db.exec("ALTER TABLE features ADD COLUMN attachments TEXT NOT NULL DEFAULT '[]'");
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
version: 29,
|
|
439
|
+
name: '029-add-feature-soft-delete',
|
|
440
|
+
sql: '',
|
|
441
|
+
handler: (db) => {
|
|
442
|
+
const columns = db.pragma('table_info(features)');
|
|
443
|
+
if (!columns.some((c) => c.name === 'deleted_at')) {
|
|
444
|
+
db.exec('ALTER TABLE features ADD COLUMN deleted_at INTEGER');
|
|
445
|
+
db.exec('CREATE INDEX IF NOT EXISTS idx_features_deleted_at ON features(deleted_at)');
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
version: 30,
|
|
451
|
+
name: '030-add-evidence-workflow-settings',
|
|
452
|
+
sql: '',
|
|
453
|
+
handler: (db) => {
|
|
454
|
+
const columns = db.pragma('table_info(settings)');
|
|
455
|
+
if (!columns.some((c) => c.name === 'workflow_enable_evidence')) {
|
|
456
|
+
db.exec('ALTER TABLE settings ADD COLUMN workflow_enable_evidence INTEGER NOT NULL DEFAULT 0');
|
|
457
|
+
}
|
|
458
|
+
if (!columns.some((c) => c.name === 'workflow_commit_evidence')) {
|
|
459
|
+
db.exec('ALTER TABLE settings ADD COLUMN workflow_commit_evidence INTEGER NOT NULL DEFAULT 0');
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
version: 31,
|
|
465
|
+
name: '031-add-pr-mergeable',
|
|
466
|
+
sql: '',
|
|
467
|
+
handler: (db) => {
|
|
468
|
+
const columns = db.pragma('table_info(features)');
|
|
469
|
+
if (!columns.some((c) => c.name === 'pr_mergeable')) {
|
|
470
|
+
db.exec('ALTER TABLE features ADD COLUMN pr_mergeable INTEGER');
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
version: 32,
|
|
476
|
+
name: '032-update-env-deploy-default',
|
|
477
|
+
sql: `UPDATE settings SET feature_flag_env_deploy = 1 WHERE feature_flag_env_deploy = 0;`,
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
version: 33,
|
|
481
|
+
name: '033-create-pr-sync-lock',
|
|
482
|
+
sql: `
|
|
483
|
+
CREATE TABLE IF NOT EXISTS pr_sync_lock (
|
|
484
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
485
|
+
locked_by TEXT NOT NULL,
|
|
486
|
+
locked_at INTEGER NOT NULL,
|
|
487
|
+
expires_at INTEGER NOT NULL
|
|
488
|
+
);
|
|
489
|
+
`,
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
version: 34,
|
|
493
|
+
name: '034-add-merge-review-notifications',
|
|
494
|
+
sql: '',
|
|
495
|
+
handler: (db) => {
|
|
496
|
+
const columns = db.pragma('table_info(settings)');
|
|
497
|
+
const add = (col) => {
|
|
498
|
+
if (!columns.some((c) => c.name === col)) {
|
|
499
|
+
db.exec(`ALTER TABLE settings ADD COLUMN ${col} INTEGER NOT NULL DEFAULT 1`);
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
add('notif_evt_pr_blocked');
|
|
503
|
+
add('notif_evt_merge_review_ready');
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
];
|
|
507
|
+
/**
|
|
508
|
+
* Transforms a LegacyMigrationDef into an umzug-compatible RunnableMigration.
|
|
509
|
+
*
|
|
510
|
+
* Each migration's up() function:
|
|
511
|
+
* 1. Wraps SQL/handler execution in db.transaction()
|
|
512
|
+
* 2. Sets PRAGMA user_version = N inside the transaction
|
|
513
|
+
*/
|
|
514
|
+
function toRunnableMigration(def) {
|
|
515
|
+
return {
|
|
516
|
+
name: def.name,
|
|
517
|
+
async up(params) {
|
|
518
|
+
const db = params.context;
|
|
519
|
+
db.transaction(() => {
|
|
520
|
+
if (def.sql) {
|
|
521
|
+
db.exec(def.sql);
|
|
522
|
+
}
|
|
523
|
+
if (def.handler) {
|
|
524
|
+
def.handler(db);
|
|
525
|
+
}
|
|
526
|
+
db.prepare(`PRAGMA user_version = ${def.version}`).run();
|
|
527
|
+
})();
|
|
528
|
+
},
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* All 34 legacy migrations as umzug-compatible RunnableMigration objects.
|
|
533
|
+
* Ordered by version number (001–034) for deterministic execution.
|
|
534
|
+
*/
|
|
535
|
+
export const LEGACY_MIGRATIONS = MIGRATION_DEFS.map(toRunnableMigration);
|
|
536
|
+
/**
|
|
537
|
+
* Ordered list of legacy migration names for use with the bootstrap seeder.
|
|
538
|
+
* E.g., ['001-create-settings-table', '002-add-agent-config', ...]
|
|
539
|
+
*/
|
|
540
|
+
export const LEGACY_MIGRATION_NAMES = MIGRATION_DEFS.map((d) => d.name);
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SQLite Migrations Module
|
|
3
3
|
*
|
|
4
|
-
* Manages database schema migrations using
|
|
5
|
-
*
|
|
6
|
-
* (
|
|
4
|
+
* Manages database schema migrations using umzug v3.
|
|
5
|
+
* Legacy migrations (V1–V34) are registered programmatically from legacy-migrations.ts.
|
|
6
|
+
* New migrations (35+) are individual .ts files in the migrations/ directory,
|
|
7
|
+
* discovered at runtime via directory scan.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* Preserves the same export API (runSQLiteMigrations, LATEST_SCHEMA_VERSION) so
|
|
10
|
+
* all 16+ importing files require zero changes.
|
|
9
11
|
*/
|
|
10
12
|
import type Database from 'better-sqlite3';
|
|
11
13
|
/**
|
|
12
|
-
* The latest schema version (highest migration version number).
|
|
14
|
+
* The latest schema version (highest legacy migration version number).
|
|
13
15
|
* Exported for test assertions so they don't hardcode version numbers.
|
|
14
16
|
*/
|
|
15
|
-
export declare const LATEST_SCHEMA_VERSION
|
|
17
|
+
export declare const LATEST_SCHEMA_VERSION = 34;
|
|
16
18
|
/**
|
|
17
19
|
* Runs all pending database migrations.
|
|
18
20
|
* Safe to call multiple times (idempotent).
|
|
19
21
|
*
|
|
20
|
-
*
|
|
22
|
+
* Internally creates an Umzug instance configured with:
|
|
23
|
+
* - SQLiteMigrationStorage (custom better-sqlite3 storage adapter)
|
|
24
|
+
* - 34 legacy inline migrations from legacy-migrations.ts
|
|
25
|
+
* - Runtime discovery for new migration files (35+)
|
|
26
|
+
* - Debug-level logger (when DEBUG_SQL is set)
|
|
21
27
|
*
|
|
22
28
|
* @param db - Database instance to run migrations on
|
|
23
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/persistence/sqlite/migrations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/persistence/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAI3C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAwFxC;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAS9E"}
|