Problem Statement
Two migration pairs share the date counter 2026061001:
database/migrations/2026061001_add_password_hash.{up,down}.sql
database/migrations/2026061001_add_user_password_hash.{up,down}.sql
The naming convention (YYYYMMDDNN_short_description.{up,down}.sql) requires <NN> to be unique for migrations on the same day. Having two 01 migrations creates a filename collision and ambiguous ordering.
Evidence
database/migrations/
2026061001_add_password_hash.up.sql ← both use 01
2026061001_add_password_hash.down.sql
2026061001_add_user_password_hash.up.sql ← both use 01
2026061001_add_user_password_hash.down.sql
Impact
Tooling that scans migrations by filename prefix could pick up the wrong migration or apply them in the wrong order. The schema.sql file has password_hash NOT NULL DEFAULT '' in the CREATE TABLE statement but the migration adds it as a column — these represent different approaches. Which migration should be applied first is ambiguous.
Proposed Solution
- Compare both migration pairs against
database/schema.sql
- Determine which migration is correct
- Rename the second pair to
2026061002_*
- Update the README.md listing to reflect the rename
- Verify that applying both in order produces the same schema as schema.sql
Acceptance Criteria
File Map
database/migrations/2026061001_add_password_hash.up.sql — rename candidate
database/migrations/2026061001_add_password_hash.down.sql — rename candidate
database/migrations/2026061001_add_user_password_hash.up.sql — rename candidate
database/migrations/2026061001_add_user_password_hash.down.sql — rename candidate
database/migrations/README.md — update listing
Labels: refactoring, bug, quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 1h
Labels: refactoring,bug,quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 1h
Backlog ID: REPO-020
Problem Statement
Two migration pairs share the date counter
2026061001:database/migrations/2026061001_add_password_hash.{up,down}.sqldatabase/migrations/2026061001_add_user_password_hash.{up,down}.sqlThe naming convention (
YYYYMMDDNN_short_description.{up,down}.sql) requires<NN>to be unique for migrations on the same day. Having two01migrations creates a filename collision and ambiguous ordering.Evidence
Impact
Tooling that scans migrations by filename prefix could pick up the wrong migration or apply them in the wrong order. The
schema.sqlfile haspassword_hash NOT NULL DEFAULT ''in the CREATE TABLE statement but the migration adds it as a column — these represent different approaches. Which migration should be applied first is ambiguous.Proposed Solution
database/schema.sql2026061002_*Acceptance Criteria
File Map
database/migrations/2026061001_add_password_hash.up.sql— rename candidatedatabase/migrations/2026061001_add_password_hash.down.sql— rename candidatedatabase/migrations/2026061001_add_user_password_hash.up.sql— rename candidatedatabase/migrations/2026061001_add_user_password_hash.down.sql— rename candidatedatabase/migrations/README.md— update listingLabels: refactoring, bug, quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 1h
Labels: refactoring,bug,quick win
Priority: Medium | Difficulty: Beginner | Estimated Effort: 1h
Backlog ID: REPO-020