ridgepole 1.0.2.beta → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +17 -0
- data/lib/ridgepole/diff.rb +9 -4
- data/lib/ridgepole/dumper.rb +1 -1
- data/lib/ridgepole/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93755589225b2104033ca2e660fdb5e4d3efa0da2784dbbd7fe4d0f1ff2a455d
|
4
|
+
data.tar.gz: 297bc45e7568a26ebec4a410cb2ce8bece3fd0c960fda4ad3955f09f58981004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32fca405de8475e0a09fcac001fbc92ed955a13ae2b2a6175b161c8cec135b5f2c99fb18d214f0e34aa0015503b2885c0c9420ae1d2912ac70b7ce98bbfbfe12
|
7
|
+
data.tar.gz: 20cebc14f9eb4976b644569af06c93c78a4573c8368dbe98447153aaabf601113a6cc8db8a2e8f3bd6def07ebb7971c5358dfcced15513e9fcc0d69903a0d233
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,15 @@
|
|
2
2
|
|
3
3
|
## 1.0
|
4
4
|
|
5
|
-
### 1.0.
|
5
|
+
### 1.0.4 (2022/03/28)
|
6
|
+
|
7
|
+
* Add warning for generated column [pull#382](https://github.com/ridgepole/ridgepole/pull/382)
|
8
|
+
|
9
|
+
### 1.0.3 (2022/02/12)
|
10
|
+
|
11
|
+
* Support Rails 7.0.2 [pull#380](https://github.com/ridgepole/ridgepole/pull/380)
|
12
|
+
|
13
|
+
### 1.0.2 (2022/02/06)
|
6
14
|
|
7
15
|
* Add support for partitioning ([pull#374](https://github.com/ridgepole/ridgepole/pull/374))
|
8
16
|
* Suppress warning of table option differences ([pull#378](https://github.com/ridgepole/ridgepole/pull/378))
|
data/README.md
CHANGED
@@ -11,6 +11,10 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
11
11
|
|
12
12
|
**Notice**
|
13
13
|
|
14
|
+
* ActiveRecord 7.x has some incompatible changes. If you get unintended differences in `datetime`, add `precision`.
|
15
|
+
* cf. https://github.com/ridgepole/ridgepole/issues/381
|
16
|
+
* For ActiveRecord 7.x series, please use AcriveRecord 7.0.2 or higher / Ridgepole 1.0.3 or higher.
|
17
|
+
* cf. https://github.com/ridgepole/ridgepole/pull/380
|
14
18
|
* ActiveRecord 6.1 is supported in ridgepole v0.9, but the ActiveRecord dump has been changed, so there is a difference between ActiveRecord 5.x/6.0 format.
|
15
19
|
* **If you use ActiveRecord 6.1, please modify Schemafile format**.
|
16
20
|
* cf. https://github.com/ridgepole/ridgepole/pull/323
|
@@ -210,6 +214,19 @@ activerecord 5.0.0 and activerecord-mysql-awesome dumps a collation rather than
|
|
210
214
|
|
211
215
|
See `mysql> show character set;` to find charset / collation pair for your system.
|
212
216
|
|
217
|
+
## Generated Column (MySQL)
|
218
|
+
|
219
|
+
There should be NO extra white spaces in the expression (such as after comma).
|
220
|
+
Quotes in expression may cause the operations failure with MySQL 8.0.
|
221
|
+
|
222
|
+
```ruby
|
223
|
+
create_table "users", force: :cascade do |t|
|
224
|
+
t.string "last_name"
|
225
|
+
t.string "first_name"
|
226
|
+
t.virtual "full_name", type: :string, as: "concat(`last_name`,' ',`first_name`)", stored: true
|
227
|
+
end
|
228
|
+
```
|
229
|
+
|
213
230
|
## Execute
|
214
231
|
```ruby
|
215
232
|
create_table "authors", force: :cascade do |t|
|
data/lib/ridgepole/diff.rb
CHANGED
@@ -422,9 +422,6 @@ module Ridgepole
|
|
422
422
|
opts[:limit] = 4_294_967_295
|
423
423
|
end
|
424
424
|
end
|
425
|
-
|
426
|
-
# Workaround for Active Record 7.0
|
427
|
-
opts.delete(:precision) if attrs[:type] == :datetime && opts[:precision].nil?
|
428
425
|
end
|
429
426
|
end
|
430
427
|
|
@@ -509,6 +506,14 @@ module Ridgepole
|
|
509
506
|
attrs2.fetch(:options).delete(:comment)
|
510
507
|
end
|
511
508
|
|
509
|
+
if attrs1[:options][:as] != attrs2[:options][:as] && attrs1[:options].fetch(:as, '').delete(' ') == attrs2[:options].fetch(:as, '').delete(' ')
|
510
|
+
@logger.warn(<<-MSG)
|
511
|
+
[WARNING] Same expressions but only differed by white spaces were detected. This operation may fail.
|
512
|
+
Before: '#{attrs1[:options][:as]}'
|
513
|
+
After : '#{attrs2[:options][:as]}'
|
514
|
+
MSG
|
515
|
+
end
|
516
|
+
|
512
517
|
attrs1 == attrs2
|
513
518
|
end
|
514
519
|
|
@@ -652,7 +657,7 @@ MSG
|
|
652
657
|
|
653
658
|
(from_partitions.keys - to_partitions.keys).each do |name|
|
654
659
|
partition_definitions_delta[:delete] ||= {}
|
655
|
-
partition_definitions_delta[:delete][name] = attrs.merge(
|
660
|
+
partition_definitions_delta[:delete][name] = attrs.merge(values: from_partitions[name][:values])
|
656
661
|
end
|
657
662
|
|
658
663
|
(to_partitions.keys - from_partitions.keys).each do |name|
|
data/lib/ridgepole/dumper.rb
CHANGED
data/lib/ridgepole/version.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -338,9 +338,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
338
338
|
version: 2.2.7
|
339
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
340
|
requirements:
|
341
|
-
- - "
|
341
|
+
- - ">="
|
342
342
|
- !ruby/object:Gem::Version
|
343
|
-
version:
|
343
|
+
version: '0'
|
344
344
|
requirements: []
|
345
345
|
rubygems_version: 3.2.32
|
346
346
|
signing_key:
|