refactor(store): migration files + embed.FS
- migrations/001_init.sql + 002_target_extras.sql extraidos de schema inline - store.go: applyMigrations() con embed.FS, splitSQLStatements, isIdempotentError - aplica regla db_migrations.md (fn_registry/.claude/rules/) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- deploy_server initial schema. Tracks deploy targets (per app+host) and execution history.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS deploy_targets (
|
||||
app TEXT NOT NULL,
|
||||
host TEXT NOT NULL,
|
||||
remote_dir TEXT NOT NULL DEFAULT '',
|
||||
binary_name TEXT NOT NULL DEFAULT '',
|
||||
build_cmd TEXT NOT NULL DEFAULT '',
|
||||
service_user TEXT NOT NULL DEFAULT '',
|
||||
port INTEGER NOT NULL DEFAULT 0,
|
||||
health_path TEXT NOT NULL DEFAULT '',
|
||||
env TEXT NOT NULL DEFAULT '{}',
|
||||
created_at TEXT NOT NULL,
|
||||
PRIMARY KEY (app, host)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS deploy_logs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
app TEXT NOT NULL,
|
||||
host TEXT NOT NULL,
|
||||
status TEXT NOT NULL,
|
||||
trigger TEXT NOT NULL DEFAULT 'manual',
|
||||
error TEXT NOT NULL DEFAULT '',
|
||||
duration_ms INTEGER NOT NULL DEFAULT 0,
|
||||
started_at TEXT NOT NULL
|
||||
);
|
||||
Reference in New Issue
Block a user