nondestructive_migrations 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/generators/data_migration_generator.rb +28 -0
- data/lib/nondestructive_migrations.rb +4 -4
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjljMzdjYWI2NDM3NjBkMzhkYWI4Njc3MGZhYjkxYTM2NjJmMjkzYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2JlZDcyZjE4YzI2ODFmNWI2ZDE4ZmIzODI4YTg1NTVjODg2NTM5Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzRmOWEwNmVkZGM5YWIwZDlmYzIwYTEwMTI4NDhmNWYyOTBmYTBlZmFkOGY3
|
10
|
+
NjQ3ZWU5MjE0Nzg0YjYyMmNlMzhhZWRlNjY3NmNjMDQ2NzJjMGQwODEyMjJi
|
11
|
+
ODQ2YzFhNWJkZTkwODU4MmE2YTY0NTk3NDc0MmMwN2FhYjBhYjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTZjMjE5MTc0ODMzM2Q5ZWM0NWMyYjg5NDAyMGY2MjU5ODY2ZGEzYTFkNWRh
|
14
|
+
YmI5MGNlNjZhODgwMWFmMjFmODgxMzdhM2JjMGQwZTFlM2IzY2JmMmRmNGQ3
|
15
|
+
YmI4N2VhNjE5Y2NmYjQ1M2RlYzhkOWJiZjkxM2MyYTQ4OTNkYTg=
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
# this is the generator used to create a data migration
|
3
|
+
|
4
|
+
class DataMigrationGenerator < ActiveRecord::Generators::Base
|
5
|
+
self.source_root(File.join(self.superclass.base_root,'active_record/migration/templates'))
|
6
|
+
|
7
|
+
desc <<-DESC
|
8
|
+
Description:
|
9
|
+
Creates new nondestructive migration
|
10
|
+
DESC
|
11
|
+
|
12
|
+
def create_data_migration_file
|
13
|
+
migration_template "migration.rb", "db/data_migrate/#{file_name}.rb"
|
14
|
+
end
|
15
|
+
|
16
|
+
# 'migration.rb' now requires this var/method
|
17
|
+
def migration_action
|
18
|
+
'create'
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# this used in migration template which is inherited, we want this values to be an empty array.
|
24
|
+
def attributes
|
25
|
+
[]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
2
|
MIGRATIONS_PATH = 'db/data_migrate'
|
3
3
|
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
4
|
+
require 'generators/data_migration_install_generator.rb'
|
5
|
+
require 'generators/data_migration_generator.rb'
|
6
|
+
require 'nondestructive_migrator.rb'
|
7
7
|
# require 'tasks/data'
|
8
8
|
|
9
9
|
module NondestructiveMigrations
|
10
|
-
require "
|
10
|
+
require "nondestructive_migrations/railtie.rb" if defined?(Rails)
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nondestructive_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fleetwood-Boldt
|
@@ -17,6 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- lib/generators/data_migration_generator.rb
|
20
21
|
- lib/generators/data_migration_install_generator.rb
|
21
22
|
- lib/nondestructive_migrations.rb
|
22
23
|
homepage: https://github.com/jasonfb/nondestructive_migrations
|