xmigra 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xmigra/db_support/mssql.rb +43 -0
- data/lib/xmigra/db_support/psql.rb +45 -0
- data/lib/xmigra/declarative_migration.rb +160 -0
- data/lib/xmigra/declarative_support/table.rb +590 -0
- data/lib/xmigra/declarative_support.rb +158 -0
- data/lib/xmigra/impdecl_migration_adder.rb +249 -0
- data/lib/xmigra/migration.rb +10 -3
- data/lib/xmigra/migration_chain.rb +22 -8
- data/lib/xmigra/migration_conflict.rb +27 -0
- data/lib/xmigra/new_access_artifact_adder.rb +44 -0
- data/lib/xmigra/new_index_adder.rb +33 -0
- data/lib/xmigra/new_migration_adder.rb +10 -6
- data/lib/xmigra/permission_script_writer.rb +11 -5
- data/lib/xmigra/program.rb +231 -23
- data/lib/xmigra/schema_updater.rb +28 -5
- data/lib/xmigra/vcs_support/git.rb +189 -8
- data/lib/xmigra/vcs_support/svn.rb +107 -1
- data/lib/xmigra/version.rb +1 -1
- data/lib/xmigra.rb +47 -2
- data/test/git_vcs.rb +64 -4
- data/test/new_files.rb +14 -0
- data/test/runner.rb +49 -4
- data/test/structure_declarative.rb +811 -0
- data/test/utils.rb +17 -2
- metadata +10 -2
data/test/utils.rb
CHANGED
@@ -25,6 +25,20 @@ class Integer
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
class StandardError
|
29
|
+
def each_causing_exception
|
30
|
+
current = self.safe_cause
|
31
|
+
until current.nil?
|
32
|
+
yield current
|
33
|
+
current = current.safe_cause
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def safe_cause
|
38
|
+
respond_to?(:cause) ? cause : nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
28
42
|
def do_or_die(command, message=nil, exc_type=Exception)
|
29
43
|
output = `#{command}`
|
30
44
|
$?.success? || raise(exc_type, message || ("Unable to " + command + "\n" + output))
|
@@ -38,10 +52,10 @@ def initialize_xmigra_schema(path='.', options={})
|
|
38
52
|
end
|
39
53
|
end
|
40
54
|
|
41
|
-
def in_xmigra_schema
|
55
|
+
def in_xmigra_schema(options={})
|
42
56
|
1.temp_dirs do |schema|
|
43
57
|
Dir.chdir(schema) do
|
44
|
-
initialize_xmigra_schema
|
58
|
+
initialize_xmigra_schema('.', options)
|
45
59
|
yield
|
46
60
|
end
|
47
61
|
end
|
@@ -76,3 +90,4 @@ def capture_stdout
|
|
76
90
|
$stdout = old_stdout
|
77
91
|
end
|
78
92
|
end
|
93
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmigra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Next IT Corporation
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -64,13 +64,19 @@ files:
|
|
64
64
|
- lib/xmigra/console.rb
|
65
65
|
- lib/xmigra/db_support/mssql.rb
|
66
66
|
- lib/xmigra/db_support/psql.rb
|
67
|
+
- lib/xmigra/declarative_migration.rb
|
68
|
+
- lib/xmigra/declarative_support.rb
|
69
|
+
- lib/xmigra/declarative_support/table.rb
|
67
70
|
- lib/xmigra/function.rb
|
71
|
+
- lib/xmigra/impdecl_migration_adder.rb
|
68
72
|
- lib/xmigra/index.rb
|
69
73
|
- lib/xmigra/index_collection.rb
|
70
74
|
- lib/xmigra/migration.rb
|
71
75
|
- lib/xmigra/migration_chain.rb
|
72
76
|
- lib/xmigra/migration_conflict.rb
|
77
|
+
- lib/xmigra/new_access_artifact_adder.rb
|
73
78
|
- lib/xmigra/new_file.rb
|
79
|
+
- lib/xmigra/new_index_adder.rb
|
74
80
|
- lib/xmigra/new_migration_adder.rb
|
75
81
|
- lib/xmigra/permission_script_writer.rb
|
76
82
|
- lib/xmigra/plugin.rb
|
@@ -87,8 +93,10 @@ files:
|
|
87
93
|
- lib/xmigra/version.rb
|
88
94
|
- lib/xmigra/view.rb
|
89
95
|
- test/git_vcs.rb
|
96
|
+
- test/new_files.rb
|
90
97
|
- test/reversions.rb
|
91
98
|
- test/runner.rb
|
99
|
+
- test/structure_declarative.rb
|
92
100
|
- test/utils.rb
|
93
101
|
- xmigra.gemspec
|
94
102
|
homepage: https://github.com/rtweeks/xmigra
|