sougatamondal / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

Exception when no migrations have been done yet #61

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi all,

I just checked out Migrator.NET from trunk and in addition to the other
issue I reported, there's also a problem when no migrations have been
applied yet. 

the MigrateAnywhere constructor tries to set the current migration version
by picking the last element from provider.AppliedMigrations, liek this:

if (_availableMigrations.Count > 0) {
  _current = provider.AppliedMigrations[provider.AppliedMigrations.Count - 1];
}

but if provider.AppliedMigrations is empty, this will produce an exception.
And since it's always empty when starting a new database fresh, this is a
problem for running migrations :)

I'm not familiar enough with the code to know how to fix this -- should
this be testing AppliedMigrations.Count instead of _availableMigrations.Count?

Thanks!

Original issue reported on code.google.com by russell....@gmail.com on 26 Aug 2008 at 7:54

GoogleCodeExporter commented 8 years ago
I also had this problem, Issue 59 :)

Original comment by flux...@gmail.com on 26 Aug 2008 at 8:31

GoogleCodeExporter commented 8 years ago
hmm, good point :)

admins: please disregard this one!

Original comment by russell....@gmail.com on 26 Aug 2008 at 8:40

GoogleCodeExporter commented 8 years ago
Many reported this issue, it looks like it's being ignored..

Original comment by simone.b...@gmail.com on 27 Aug 2008 at 4:10

GoogleCodeExporter commented 8 years ago
Hmm, I guess I could send a patch but it would take more time to apply the 
patch than
for the maintainers to make the one-line change :)

Original comment by russell....@gmail.com on 27 Aug 2008 at 4:16

GoogleCodeExporter commented 8 years ago
Duplicates: Issue 54

Original comment by geoffl...@gmail.com on 27 Aug 2008 at 4:45