dohmysql 0.2.4 → 0.2.5
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.
- data/lib/doh/mysql/database_creator.rb +10 -7
- metadata +2 -2
@@ -93,15 +93,18 @@ private
|
|
93
93
|
|
94
94
|
def apply_migrates(dbh, source_db)
|
95
95
|
apply_files = find_files("#{source_db}/migrate/*_apply.sql")
|
96
|
-
apply_files.
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
96
|
+
migrates = apply_files.collect {|path| File.basename(path).slice(0..-11)}
|
97
|
+
|
98
|
+
migrates.each do |name|
|
99
|
+
base, divider, _ = name.partition('_after')
|
100
|
+
next if divider.empty?
|
101
|
+
|
102
|
+
if migrates.include?("#{base}_before")
|
103
|
+
file_ending = "#{name}_apply.sql"
|
104
|
+
apply_files.delete_if {|path| path.end_with?(file_ending)}
|
103
105
|
end
|
104
106
|
end
|
107
|
+
|
105
108
|
DohDb.load_sql(@connector.config, apply_files)
|
106
109
|
apply_files.each do |path|
|
107
110
|
migrate_name = File.basename(path).slice(0..-11)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohmysql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-08-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dohroot
|