public
Fork of joshsusser/migration_concordance
Description: Ruby on Rails plugin to provide notification when you need to run migrations
Homepage: http://blog.hasmanythrough.com/2008/3/2/migration-concordance
Clone URL: git://github.com/davidhq/migration_concordance.git
Search Repo:
running db:migrate on up-to-date db should generate a snapshot
davidhq (author)
Tue Apr 15 17:36:12 -0700 2008
commit  ec5034790abf021dc9c9362fba0bfd1b0d17d2f1
tree    0170f78dd71b99a40ff8519e0d32ee6f34fa1446
parent  c30cebe19ee9fd63f4b5396abe6ec1ad1a366f3b
...
26
27
28
29
 
30
31
32
...
44
45
46
47
 
48
49
50
...
26
27
28
 
29
30
31
32
...
44
45
46
 
47
48
49
50
0
@@ -26,7 +26,7 @@ module ActiveRecord
0
         when false
0
           mc_green("***** DB schema is in sync with migrations.")
0
         when 0
0
- mc_yellow("***** DB schema state unknown. No migration snapshot to compare.")
0
+ mc_yellow("***** DB schema state unknown. Generating a snapshot ...")
0
         else
0
           changed = differs.split("_").first.to_i
0
           current = current_version rescue 0
0
@@ -44,7 +44,7 @@ module ActiveRecord
0
         else
0
           old_version = current_version rescue nil
0
           migrate_without_snapshot(migrations_path, target_version)
0
- if current_version != old_version
0
+ if (current_version != old_version) || !File.exists?(snapshot_path)
0
             snapshot = generate_snapshot(migrations_path)
0
             lines = YAML.dump(snapshot).split("\n").sort
0
             File.open(snapshot_path, "w") { |f| f.puts(lines) }

Comments

    No one has commented yet.