ridgepole 1.0.3 → 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 +4 -0
- data/README.md +16 -1
- data/lib/ridgepole/diff.rb +9 -1
- data/lib/ridgepole/version.rb +1 -1
- metadata +2 -2
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
data/README.md
CHANGED
@@ -11,7 +11,9 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
11
11
|
|
12
12
|
**Notice**
|
13
13
|
|
14
|
-
|
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.
|
15
17
|
* cf. https://github.com/ridgepole/ridgepole/pull/380
|
16
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.
|
17
19
|
* **If you use ActiveRecord 6.1, please modify Schemafile format**.
|
@@ -212,6 +214,19 @@ activerecord 5.0.0 and activerecord-mysql-awesome dumps a collation rather than
|
|
212
214
|
|
213
215
|
See `mysql> show character set;` to find charset / collation pair for your system.
|
214
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
|
+
|
215
230
|
## Execute
|
216
231
|
```ruby
|
217
232
|
create_table "authors", force: :cascade do |t|
|
data/lib/ridgepole/diff.rb
CHANGED
@@ -506,6 +506,14 @@ module Ridgepole
|
|
506
506
|
attrs2.fetch(:options).delete(:comment)
|
507
507
|
end
|
508
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
|
+
|
509
517
|
attrs1 == attrs2
|
510
518
|
end
|
511
519
|
|
@@ -649,7 +657,7 @@ MSG
|
|
649
657
|
|
650
658
|
(from_partitions.keys - to_partitions.keys).each do |name|
|
651
659
|
partition_definitions_delta[:delete] ||= {}
|
652
|
-
partition_definitions_delta[:delete][name] = attrs.merge(
|
660
|
+
partition_definitions_delta[:delete][name] = attrs.merge(values: from_partitions[name][:values])
|
653
661
|
end
|
654
662
|
|
655
663
|
(to_partitions.keys - from_partitions.keys).each do |name|
|
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
|