ridgepole 0.5.2 → 0.5.3.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +9 -1
- data/lib/ridgepole/delta.rb +1 -1
- data/lib/ridgepole/execute_expander.rb +26 -0
- data/lib/ridgepole/version.rb +1 -1
- data/ridgepole.gemspec +1 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6f3221edd3f0db3334b481616217bc488b28cb4
|
4
|
+
data.tar.gz: fa689ed8f59a113eb1541de008812b441e191ae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6925b000bb61e97563d33f434e6c14905abbdf51262e61e1e3eaddcb5e9f18b76683a799c8e487ee185f02ce49e306926f66cfc6a83db327e86d936bad6f54
|
7
|
+
data.tar.gz: 3e3c2b1a5e0a034842e7cda882c55b90773e89910a489c7077558df4e050063622b808b6c6c0e253cfdb4d8feb65a1c0fa5e5cf72dbd89e0b438bafb812bd4e2
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -25,7 +25,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
25
25
|
* Fix rails version `< 4.2.0`
|
26
26
|
* `>= 0.5.2`
|
27
27
|
* Add `--enable-mysql-awesome` option ([activerecord-mysql-awesome](https://github.com/kamipo/activerecord-mysql-awesome) is required `>= 0.0.3`)
|
28
|
-
* It is not possible to enable both `--enable-mysql-awesome` and
|
28
|
+
* It is not possible to enable both `--enable-mysql-awesome` and `--enable-migration-comments`, `--enable-mysql-awesome` and `--enable-mysql-unsigned`, `--enable-mysql-awesome` and `--enable-mysql-pkdump`
|
29
29
|
* Fix foreigner version `<= 1.7.1`
|
30
30
|
|
31
31
|
## Installation
|
@@ -208,6 +208,14 @@ create_table "books", id: "bigint(20) PRIMARY KEY auto_increment", force: true d
|
|
208
208
|
end
|
209
209
|
```
|
210
210
|
|
211
|
+
If you use `--enable-mysql-awesome`:
|
212
|
+
|
213
|
+
```ruby
|
214
|
+
create_table "books", id: :bigint, force: true do |t|
|
215
|
+
...
|
216
|
+
end
|
217
|
+
```
|
218
|
+
|
211
219
|
## Execute
|
212
220
|
```ruby
|
213
221
|
create_table "authors", force: true do |t|
|
data/lib/ridgepole/delta.rb
CHANGED
@@ -59,7 +59,7 @@ class Ridgepole::Delta
|
|
59
59
|
buf = StringIO.new
|
60
60
|
|
61
61
|
callback = proc do |sql, name|
|
62
|
-
buf.puts sql if sql =~ /\A(CREATE|ALTER|DROP|RENAME)\b/i
|
62
|
+
buf.puts sql if sql =~ /\A(CREATE|ALTER|DROP|RENAME|COPY)\b/i
|
63
63
|
end
|
64
64
|
|
65
65
|
Ridgepole::ExecuteExpander.without_operation(callback) do
|
@@ -69,3 +69,29 @@ module ActiveRecord::ConnectionAdapters::SchemaStatements
|
|
69
69
|
end
|
70
70
|
alias_method_chain :index_name_exists?, :noop
|
71
71
|
end
|
72
|
+
|
73
|
+
require 'active_record/connection_adapters/sqlite3_adapter'
|
74
|
+
|
75
|
+
class ActiveRecord::ConnectionAdapters::SQLite3Adapter
|
76
|
+
def exec_query_with_noop(sql, name = nil, binds = [])
|
77
|
+
if Ridgepole::ExecuteExpander.noop
|
78
|
+
if (callback = Ridgepole::ExecuteExpander.callback)
|
79
|
+
callback.call(sql, name)
|
80
|
+
end
|
81
|
+
else
|
82
|
+
exec_query_without_noop(sql, name, binds)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
alias_method_chain :exec_query, :noop
|
86
|
+
|
87
|
+
def copy_table_with_noop(from, to, options = {})
|
88
|
+
if Ridgepole::ExecuteExpander.noop
|
89
|
+
if (callback = Ridgepole::ExecuteExpander.callback)
|
90
|
+
callback.call("COPY TABLE #{from} TO #{to}")
|
91
|
+
end
|
92
|
+
else
|
93
|
+
copy_table_without_noop(from, to, options)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
alias_method_chain :copy_table, :noop
|
97
|
+
end
|
data/lib/ridgepole/version.rb
CHANGED
data/ridgepole.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency 'rake'
|
24
24
|
spec.add_development_dependency 'rspec', '>= 3.0.0'
|
25
25
|
spec.add_development_dependency 'mysql2'
|
26
|
+
spec.add_development_dependency 'sqlite3'
|
26
27
|
spec.add_development_dependency 'coveralls'
|
27
28
|
spec.add_development_dependency 'activerecord-mysql-unsigned', '~> 0.3.1'
|
28
29
|
spec.add_development_dependency 'foreigner', '<= 1.7.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sqlite3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: coveralls
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,9 +282,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
268
282
|
version: '0'
|
269
283
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
284
|
requirements:
|
271
|
-
- - '
|
285
|
+
- - '>'
|
272
286
|
- !ruby/object:Gem::Version
|
273
|
-
version:
|
287
|
+
version: 1.3.1
|
274
288
|
requirements: []
|
275
289
|
rubyforge_project:
|
276
290
|
rubygems_version: 2.0.14
|