seed_data_migrations 0.0.1.10 → 0.0.1.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,15 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
db_namespace = namespace :db do
|
8
|
+
|
9
|
+
desc "Migrate the seed data (options: VERSION=x, VERBOSE=false, SCOPE=blog)."
|
10
|
+
task :migrate_data => [:environment, :load_config] do
|
11
|
+
ActiveRecord::DataMigration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
|
12
|
+
ActiveRecord::DataMigrator.migrate(ActiveRecord::DataMigrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
|
13
|
+
ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
8
17
|
# rake db:migrate_data --trace
|
9
18
|
desc "migrate seed data in /db/seeds/*"
|
10
19
|
namespace :migrate_data do
|