I am batman
This commit is contained in:
15
.github/instructions/database.md
vendored
Normal file
15
.github/instructions/database.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Database Instructions
|
||||
|
||||
## Scope
|
||||
- Applies to GORM models in `internal/models` and migration behavior in `internal/database/database.go`.
|
||||
|
||||
## Rules
|
||||
- Define explicit foreign keys for non-trivial relations (`foreignKey`, `references`) to avoid inference errors.
|
||||
- Avoid introducing `NOT NULL` constraints on existing populated tables without a backfill plan.
|
||||
- Keep `AutoMigrate` additive-first; prefer safe schema transitions over breaking changes.
|
||||
- Use deterministic ordering fields (`position`) for UI-driven entities (kanban sections/tasks).
|
||||
- Ensure seed data aligns with current schema and relation requirements.
|
||||
|
||||
## Migration Safety
|
||||
- For legacy data, introduce nullable columns first, backfill, then tighten constraints in a later step.
|
||||
- Never assume empty tables in shared dev environments.
|
||||
Reference in New Issue
Block a user