diff options
| author | soryu <soryu@soryu.co> | 2026-01-11 05:52:14 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-15 00:21:16 +0000 |
| commit | 87044a747b47bd83249d61a45842c7f7b2eae56d (patch) | |
| tree | ef2000ce79ffcc2723ef841acef5aa1deb1d5378 /makima/migrations/20250113000000_add_repo_file_path.sql | |
| parent | 077820c4167c168072d217a1b01df840463a12a8 (diff) | |
| download | soryu-87044a747b47bd83249d61a45842c7f7b2eae56d.tar.gz soryu-87044a747b47bd83249d61a45842c7f7b2eae56d.zip | |
Contract system
Diffstat (limited to 'makima/migrations/20250113000000_add_repo_file_path.sql')
| -rw-r--r-- | makima/migrations/20250113000000_add_repo_file_path.sql | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/makima/migrations/20250113000000_add_repo_file_path.sql b/makima/migrations/20250113000000_add_repo_file_path.sql new file mode 100644 index 0000000..eb7cec2 --- /dev/null +++ b/makima/migrations/20250113000000_add_repo_file_path.sql @@ -0,0 +1,15 @@ +-- Add repository file path linking to files +-- Files can now be linked to specific file paths in repositories + +ALTER TABLE files ADD COLUMN repo_file_path VARCHAR(500) NULL; +ALTER TABLE files ADD COLUMN repo_synced_at TIMESTAMPTZ NULL; +ALTER TABLE files ADD COLUMN repo_sync_status VARCHAR(50) DEFAULT 'none'; +-- Status: 'none' (not linked), 'synced' (up to date), 'modified' (local changes), 'conflict' + +-- Index for efficient lookup of files by repo path within a contract +CREATE INDEX idx_files_repo_file_path ON files(contract_id, repo_file_path) +WHERE repo_file_path IS NOT NULL; + +COMMENT ON COLUMN files.repo_file_path IS 'Path to the file in the repository (e.g., README.md, docs/design.md)'; +COMMENT ON COLUMN files.repo_synced_at IS 'When the file was last synced from the repository'; +COMMENT ON COLUMN files.repo_sync_status IS 'Sync status: none, synced, modified, conflict'; |
