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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e83bd61a718b5b97d6be9214742e452fce8c54e9bff48e2b604344753138c0bb
4
- data.tar.gz: f2ed01a46f18174e3173f07715002fc222467a341d9e93682910ef2c2497d613
3
+ metadata.gz: 93755589225b2104033ca2e660fdb5e4d3efa0da2784dbbd7fe4d0f1ff2a455d
4
+ data.tar.gz: 297bc45e7568a26ebec4a410cb2ce8bece3fd0c960fda4ad3955f09f58981004
5
5
  SHA512:
6
- metadata.gz: 62a7e740ec77f0124b3b9776a3c78fc8186a9f00d0f97917cae79342664f1a77e1f2ce3992e7e6e463c8fad76e2fba92af0f9a6031a70f7d545768dae2942ba1
7
- data.tar.gz: 2f43e6f67be8820450c9fd47ddde4dacabe69778bbc1d3837b9ce8988e6b7393f80df3ed5a400a142a0a20a06c58344aa08490ea81cc25d4fdb10b56de824aec
6
+ metadata.gz: 32fca405de8475e0a09fcac001fbc92ed955a13ae2b2a6175b161c8cec135b5f2c99fb18d214f0e34aa0015503b2885c0c9420ae1d2912ac70b7ce98bbfbfe12
7
+ data.tar.gz: 20cebc14f9eb4976b644569af06c93c78a4573c8368dbe98447153aaabf601113a6cc8db8a2e8f3bd6def07ebb7971c5358dfcced15513e9fcc0d69903a0d233
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## 1.0
4
4
 
5
+ ### 1.0.4 (2022/03/28)
6
+
7
+ * Add warning for generated column [pull#382](https://github.com/ridgepole/ridgepole/pull/382)
8
+
5
9
  ### 1.0.3 (2022/02/12)
6
10
 
7
11
  * Support Rails 7.0.2 [pull#380](https://github.com/ridgepole/ridgepole/pull/380)
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
- For ActiveRecord 7.x series, please use AcriveRecord 7.0.2 or higher / Ridgepole 1.0.3 or higher.
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|
@@ -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(valuve: from_partitions[name][:values])
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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ridgepole
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  end
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.3
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-02-11 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord