online_migrations 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f7396712072756a2c7de52a7057f0c46da8ce26bf59270f0f2dea42bf43d0b3
4
- data.tar.gz: a3a26397aa2a279e996e8af2e7c698ebabc73ee38bad89b84e98cbddb609feb4
3
+ metadata.gz: 3dcce4daf35232504ad0f681e81c147d71bc9a1e34004cd387c50a89f6ef66df
4
+ data.tar.gz: 0ae067917657f91f5956589cb1720faf6232fff7259b906ff69dd8bf13c35ecb
5
5
  SHA512:
6
- metadata.gz: d897c787f1b4e23436ecc362dd49a97eba529e7f0613fe71d38b4fde1cd740a40e0fa6ba2ef59d32f0ab6c1050ebc98728a1830d22679f98671305e1d82d6eb3
7
- data.tar.gz: 10c2d6cc695042052c994111f71df5e19d17cf2b81a72b4ca2bce835ecced1a91dad0bfe5d2091079661c1d97dbbf066e641b80ceca196be7dd5c0e859f8ea09
6
+ metadata.gz: 9652ccc8a70af95729cfe33fd039ad5c5120a6d497b8b5334463dbc6ea5f5d4440f9cfbd948f40127f7f3a2a89ec5b2ad4a0032c85907fadb368192127aba6f1
7
+ data.tar.gz: a5da561d0357d0f58aeaf29bd83688cd08c67e9f85dae7b7c806e347c49c2bc3a0c8410f25449cc37d952be7079be030ec591df8a9a6e072e5a1acd82d7a2a7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## 0.9.1 (2023-10-30)
4
+
5
+ - Fix copying expression indexes when changing column type
6
+
3
7
  ## 0.9.0 (2023-10-27)
4
8
 
5
9
  - Add ability to use custom raw sql for `backfill_column_for_type_change`'s `type_cast_function`
@@ -405,9 +405,15 @@ module OnlineMigrations
405
405
  to_column = to_column.to_s
406
406
 
407
407
  __indexes_for(table_name, from_column).each do |index|
408
- new_columns = index.columns.map do |column|
409
- column == from_column ? to_column : column
410
- end
408
+ new_columns =
409
+ # Expression index.
410
+ if index.columns.is_a?(String)
411
+ index.columns.gsub(from_column, to_column)
412
+ else
413
+ index.columns.map do |column|
414
+ column == from_column ? to_column : column
415
+ end
416
+ end
411
417
 
412
418
  # This is necessary as we can't properly rename indexes such as "taggings_idx".
413
419
  if !index.name.include?(from_column)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnlineMigrations
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: online_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - fatkodima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-26 00:00:00.000000000 Z
11
+ date: 2023-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord