Skip to content

Replace AutoMigrate with a real migration tool #9

@koinsaari

Description

@koinsaari

internal/db.Migrate uses GORM's AutoMigrate plus a raw CREATE INDEX. Works for adding columns; cannot handle drops, renames, backfills, or index removal.

Suggested approach

  • Adopt golang-migrate or goose.
  • Versioned SQL files under migrations/.
  • Run migrations on API startup or via a separate command.
  • Treat the existing schema as migration 0001_init.

Metadata

Metadata

Assignees

Labels

area:dbDatabase layer / migrationspriority:shouldShould-have, rough edges

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions