meta: add database migrations; set up migration CLI
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I0cbc9798243134d36f788099ecc3ee5a6a6a6964
This commit is contained in:
parent
63e1fbe554
commit
a4c3cd1517
9 changed files with 366 additions and 0 deletions
26
crates/common/migrations/README.md
Normal file
26
crates/common/migrations/README.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Database Migrations
|
||||
|
||||
This directory contains SQL migrations for the FC database.
|
||||
|
||||
## Migration Files
|
||||
|
||||
- `001_initial_schema.sql`: Creates the core database schema including projects,
|
||||
jobsets, evaluations, builds, and related tables.
|
||||
|
||||
## Running Migrations
|
||||
|
||||
The easiest way to run migrations is to use the vendored CLI, `fc-migrate`.
|
||||
Packagers should vendor this crate if possible.
|
||||
|
||||
```bash
|
||||
# Run all pending migrations
|
||||
fc-migrate up postgresql://user:password@localhost/fc_ci
|
||||
|
||||
# Validate current schema
|
||||
fc-migrate validate postgresql://user:password@localhost/fc_ci
|
||||
|
||||
# Create a new migration
|
||||
fc-migrate create migration_name
|
||||
```
|
||||
|
||||
TODO: add or generate schema overviews
|
||||
Loading…
Add table
Add a link
Reference in a new issue