Skip to content

feat/server: add automatic DB migrations via refinery#25

Merged
ClemPera merged 3 commits intomainfrom
feat/server-auto-migrations
Apr 14, 2026
Merged

feat/server: add automatic DB migrations via refinery#25
ClemPera merged 3 commits intomainfrom
feat/server-auto-migrations

Conversation

@ClemPera
Copy link
Copy Markdown
Owner

  • Add refinery dep with mysql_async feature
  • Add migrations/V1__init.sql with user, user_token and note tables
  • Run migrations at server startup before binding the listener
  • Change main() to return anyhow::Result<()>

claude added 3 commits April 13, 2026 07:59
- Add refinery dep with mysql_async feature
- Add migrations/V1__init.sql with user, user_token and note tables
- Run migrations at server startup before binding the listener
- Change main() to return anyhow::Result<()>
refinery-core 0.8 only supports mysql_async <= 0.35 while the project
uses 0.36, causing an AsyncMigrate trait bound conflict.

Replace with a minimal migration runner in migrations.rs that:
- Creates schema_migrations table for version tracking
- Runs each unapplied SQL file in order using the existing Conn
- Records applied versions with timestamps
- Embeds SQL files at compile time via include_str!
@ClemPera ClemPera merged commit 0d9785b into main Apr 14, 2026
6 checks passed
@ClemPera ClemPera deleted the feat/server-auto-migrations branch April 14, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants