rubenv / rubenv/sql-migrate

MemoryMigrationSource execution order is wrong

Open
#253 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3.4k
Forks
292
PR merge metrics
No merged PRs in 30d

Description

Dear author(s), thank you very much for this library.

I have just found a little bug in it, I'm using it as a library based on the example in the main README.md. So I was all right until I had migration_0, migration_1, migration_2 as ids, but upon reaching migration_10 it broke. So I'm guessing the ordering is the "naive" ordering, that results in something like this: 0,1,10,2,3,4.

So probably we'd need some kind of a natural sorting in here, and this might affect other sources too, I'm not sure.

Anyhow, for now I'll go with 0001, 0002, ..., 0010 to solve this, but thought to report it anyhow.

Cheers!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MemoryMigrationSource and the library usage described in README.md. Reproduce the ordering with migration_0 through migration_10, then inspect whether other migration sources are affected. Done means migrations execute in natural numeric order rather than placing migration_10 before migration_2.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.