feat: add DBML schema files and relspecgo migration generation
- Add schema/*.dbml covering all existing tables (001-019) - Wire relspecgo via make generate-migrations target - Add make check-schema-drift for CI drift detection - Add schema/README.md documenting the DBML-first workflow Closes #19
This commit is contained in:
21
schema/files.dbml
Normal file
21
schema/files.dbml
Normal file
@@ -0,0 +1,21 @@
|
||||
Table stored_files {
|
||||
id bigserial [pk]
|
||||
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
||||
thought_id uuid [ref: > thoughts.guid]
|
||||
project_id uuid [ref: > projects.guid]
|
||||
name text [not null]
|
||||
media_type text [not null]
|
||||
kind text [not null, default: 'file']
|
||||
encoding text [not null, default: 'base64']
|
||||
size_bytes bigint [not null]
|
||||
sha256 text [not null]
|
||||
content bytea [not null]
|
||||
created_at timestamptz [not null, default: `now()`]
|
||||
updated_at timestamptz [not null, default: `now()`]
|
||||
|
||||
indexes {
|
||||
thought_id
|
||||
project_id
|
||||
sha256
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user