nondestructive_migrations 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjU4NDRjNjlhZjZiMjg1MTk2NmM4MTJmZjlmODNlZjgzMTc1YWI4OA==
4
+ Y2YxYzg0YjM3YzU4YjQ1OTQ3ZWUxMjVlYWM2M2Y0YjY3ZTlkYzZkZQ==
5
5
  data.tar.gz: !binary |-
6
- ZDJhMzE2ODVjYmU0NDQ5Njk1MzRjYWY5OWQ0YjA3MzQ4NjllNjgxYw==
6
+ ZjA2ODgzN2U3NmVjMWExYmM2NzNjYjViNzVlZTUwMmE5OWM2OTNiOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDI2YzVkNmE4MGU5NTg4MjJkZmEzODI1YTJlNzI4MTI0Yjk2ODgwNWQyYTFm
10
- ZGE3YjhkNzY4OTg0MGNlNDk3M2RhNDUxYjJmNDFiMjA4MzQ3MDJlZjFiZjI5
11
- OTUwYTUyMDVkNjFhZDVkODc3MzVhZjg1ZDcyYWM2YmE5MGI1ZWM=
9
+ Y2M1MDc0ZjYzOThlMzcyMTVhMWFiOWZlNmRkMzU2MDBkZGQwNmE3MzEyN2Jj
10
+ MmQ4MDVkMDAwZmVlOTlhZTA4ZDY1NzAxOTRlYjdiNDZlOTdjZjgwOTVlMTMx
11
+ M2JhYWU2NGM4NzVlZjQ3Njc4ZjJkZDBlN2E3MjFjNDIxMzg5MjI=
12
12
  data.tar.gz: !binary |-
13
- OGY5MTEyYjBiMTQyNjgxMmU0YTY4MTNiYmI1ZTQwYjJhMjk5ODI3ZGI3NTg0
14
- MDQ2NjYyNDM1NTNiMGZmMGJhMzZmNDZkYWJhM2UzY2U0ZjlhMGU4NmRjZTVh
15
- M2M0NTRjOGY3ZTQzZDYwZDdjNDA2YTQ0NDNkMjRjYTBhNjNjN2E=
13
+ NGRlN2FlOTA5NTFkNGU4ZGM2NmIzMWYxYjgzYTE4YjZhMGVkMWNjYjkyYzlh
14
+ ZDAxZTVhOWViZmQwNDJkNWY4MDU2YjFlZjc1NmRmYzk1MzFjODg2YWE1MWMw
15
+ MjI5MDQ1MjY4ZmIxZGNlZTZlNGYyMzlkZDA3Mjc1OTM0M2Q4ZjY=
@@ -0,0 +1,11 @@
1
+ class CreateDataMigrations < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :data_migrations do |t|
4
+ t.string :version
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ drop_table :data_migrations
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ require 'nondestructive_migrations'
2
+ require 'rails'
3
+
4
+ module DataMigrations
5
+ class Railtie < Rails::Railtie
6
+ rake_tasks do
7
+ require 'tasks/data.rb'
8
+ end
9
+ end
10
+ end
data/lib/tasks/data.rb ADDED
@@ -0,0 +1,34 @@
1
+
2
+
3
+ namespace :data do
4
+ task :data_migration_dependencies => :environment do
5
+ require 'nondestructive_migrations'
6
+ end
7
+
8
+ desc "run data migration (#{MIGRATIONS_PATH})"
9
+ task :migrate => :data_migration_dependencies do
10
+ NondestructiveMigrator.migrate(MIGRATIONS_PATH)
11
+ end
12
+
13
+ desc "rollback data migration (#{MIGRATIONS_PATH})"
14
+ task :rollback => :data_migration_dependencies do
15
+ step = ENV['STEP'] ? ENV['STEP'].to_i : 1
16
+ NondestructiveMigrator.rollback(MIGRATIONS_PATH,step)
17
+ end
18
+
19
+ namespace :migrate do
20
+ desc %Q{runs the "up" for a given _data_ migration VERSION}
21
+ task :up => :data_migration_dependencies do
22
+ version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
23
+ raise "VERSION is required" unless version
24
+ NondestructiveMigrator.run(:up, MIGRATIONS_PATH, version)
25
+ end
26
+
27
+ desc %Q{runs the "down" for a given _data_ migration VERSION}
28
+ task :down => :data_migration_dependencies do
29
+ version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
30
+ raise "VERSION is required" unless version
31
+ NondestructiveMigrator.run(:down, MIGRATIONS_PATH, version)
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nondestructive_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Fleetwood-Boldt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-30 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Separate schema-only migrations from nondestrucitve (data) migrations
14
14
  in your Rails app
@@ -19,8 +19,11 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - lib/generators/data_migration_generator.rb
21
21
  - lib/generators/data_migration_install_generator.rb
22
+ - lib/generators/templates/create_data_migrations.rb
22
23
  - lib/nondestructive_migrations.rb
24
+ - lib/nondestructive_migrations/railtie.rb
23
25
  - lib/nondestructive_migrator.rb
26
+ - lib/tasks/data.rb
24
27
  homepage: https://github.com/jasonfb/nondestructive_migrations
25
28
  licenses:
26
29
  - MIT