data_migrator 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +0 -0
- data/README.rdoc +0 -0
- data/db/migrate/20100819181805_create_data_migrations_table.rb +0 -0
- data/lib/data_migrator.rb +5 -7
- data/lib/generators/data_migration/USAGE +0 -0
- data/lib/generators/data_migration/data_migration_generator.rb +0 -0
- data/lib/generators/data_migration/templates/migration_template.rb +0 -0
- data/lib/tasks/data_migrator.rake +0 -0
- data/test/data_migrator_test.rb +0 -0
- data/test/test_helper.rb +0 -0
- metadata +30 -53
data/MIT-LICENSE
CHANGED
File without changes
|
data/README.rdoc
CHANGED
File without changes
|
File without changes
|
data/lib/data_migrator.rb
CHANGED
@@ -88,7 +88,7 @@ module RussellEdge
|
|
88
88
|
filename, version, klass_name = seperate_file_parts(file)
|
89
89
|
if passed_version == version
|
90
90
|
found = true
|
91
|
-
(version_has_been_migrated?(version)) ? (puts "** Version #{passed_version} has not been migrated")
|
91
|
+
(version_has_been_migrated?(version)) ? handle_action(file, klass_name, version, :down) : (puts "** Version #{passed_version} has not been migrated")
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -201,7 +201,8 @@ module RussellEdge
|
|
201
201
|
end
|
202
202
|
time_str = "(%.4fs)" % time.real
|
203
203
|
puts "================Finished #{klass.to_s} in #{time_str}=="
|
204
|
-
|
204
|
+
|
205
|
+
(action == :up) ? insert_migration_version(version) : remove_migration_version(version)
|
205
206
|
end
|
206
207
|
|
207
208
|
def insert_migration_version(version)
|
@@ -218,11 +219,8 @@ module RussellEdge
|
|
218
219
|
db_result = ActiveRecord::Base.connection.select_all("select count(*) as num_rows from data_migrations where version = '#{version}'")
|
219
220
|
|
220
221
|
num_rows = db_result[0]['num_rows'] unless db_result == -1
|
221
|
-
|
222
|
-
if num_rows.nil? || num_rows.to_i == 0
|
223
|
-
result = false
|
224
|
-
end
|
225
|
-
|
222
|
+
|
223
|
+
result = false if (num_rows.nil? || num_rows.to_i == 0)
|
226
224
|
result
|
227
225
|
end
|
228
226
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/data_migrator_test.rb
CHANGED
File without changes
|
data/test/test_helper.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,47 +1,34 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_migrator
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 5
|
9
|
-
version: "1.5"
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.6'
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Russell Holmes, Adam Hull
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-22 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: activerecord
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2161558960 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 9
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 3
|
32
|
-
- 5
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 2.3.5
|
34
22
|
type: :runtime
|
35
|
-
|
36
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2161558960
|
25
|
+
description: Allows you to create data migrations that can be run up and down to insert
|
26
|
+
data into the database.
|
37
27
|
email: russellfholmes@gmail.com
|
38
28
|
executables: []
|
39
|
-
|
40
29
|
extensions: []
|
41
|
-
|
42
30
|
extra_rdoc_files: []
|
43
|
-
|
44
|
-
files:
|
31
|
+
files:
|
45
32
|
- db/migrate/20100819181805_create_data_migrations_table.rb
|
46
33
|
- lib/data_migrator.rb
|
47
34
|
- lib/generators/data_migration/data_migration_generator.rb
|
@@ -52,40 +39,30 @@ files:
|
|
52
39
|
- README.rdoc
|
53
40
|
- test/data_migrator_test.rb
|
54
41
|
- test/test_helper.rb
|
55
|
-
has_rdoc: true
|
56
42
|
homepage: https://github.com/portablemind/data_migrator
|
57
43
|
licenses: []
|
58
|
-
|
59
44
|
post_install_message:
|
60
45
|
rdoc_options: []
|
61
|
-
|
62
|
-
require_paths:
|
46
|
+
require_paths:
|
63
47
|
- lib
|
64
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
49
|
none: false
|
66
|
-
requirements:
|
67
|
-
- -
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
|
70
|
-
|
71
|
-
- 0
|
72
|
-
version: "0"
|
73
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
55
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
|
79
|
-
segments:
|
80
|
-
- 0
|
81
|
-
version: "0"
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
82
60
|
requirements: []
|
83
|
-
|
84
61
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 1.8.6
|
86
63
|
signing_key:
|
87
64
|
specification_version: 3
|
88
65
|
summary: Creates Data Migrations for data similar to schema migrations.
|
89
|
-
test_files:
|
66
|
+
test_files:
|
90
67
|
- test/data_migrator_test.rb
|
91
68
|
- test/test_helper.rb
|