rails-rebase-migrations 1.4.0 → 1.5.0

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: cd756db64d02ec972889dbc148d730fee1ccf8102ec3c80cfd1ed299653d3c89
4
- data.tar.gz: a1a9750ac2e72346619f0e2e2271c05b5783875649ae923bef3c449bbf620805
3
+ metadata.gz: 52e057c21fc0b84f65f95a81aaed67cc1f470d253fc1f19cb4d70a2f048f5eee
4
+ data.tar.gz: 66cedc9a7c2445a52e1dc5bca8c8ee0c45572cba438375b81b4a31ab68bc11a4
5
5
  SHA512:
6
- metadata.gz: e01fb8d18a9870c0f7bd963e2d51f1e7df278d11903915fe74c5272554dcd41ec8759276be3f06cdda3ed6650365bb570f66f3a16e03e19a7e9ca27f1e86e3ad
7
- data.tar.gz: 562f42713263f8e25bc65c7deb2fdc3083b2b0f9406333ff709646d48ecc956308fafa70b7066598da46c6f63e898583639b17b048a839125e4c0d2c3e853f4e
6
+ metadata.gz: 3d1d59029ffea4f45ff82813516c74f6f12a104bdbb5d4855e2fe3c495569fa5f0d25d8140daf6f7c2cdea63839a8384deacf98606c7df35185157bd1ca37e3f
7
+ data.tar.gz: 60eb484ef03ed45a3f8e609f6458f58cabcefa27ec65a35c2b675771daeec94d17fd5c84bf39072e2a3de869d9a79de7414ae909f7eefb21f2c3d5be0bf69ad8
@@ -7,6 +7,7 @@ require 'time'
7
7
 
8
8
  class RebaseMigrations
9
9
  SKIP_REBASE = '_skip_rebase_'
10
+ SQUASHED_MIGRATIONS = '_squashed_migrations.rb'
10
11
 
11
12
  MIGRATIONS_DIR = 'db/migrate/'
12
13
  MIGRATION_NAME_RE = /\A(\d+)(.*)\z/
@@ -29,7 +30,7 @@ class RebaseMigrations
29
30
  last_timestamp = match[1]
30
31
  now = [Time.now.utc, Time.strptime("#{last_timestamp}Z", "#{TIME_FORMAT}%Z")].max.to_i
31
32
 
32
- all_migrations.each do |path|
33
+ all_migrations.each.with_index do |path, index|
33
34
  next if ref_migrations.include?(path)
34
35
 
35
36
  basename = File.basename(path)
@@ -38,6 +39,9 @@ class RebaseMigrations
38
39
  migration_name_base = match[2]
39
40
  next if migration_name_base.start_with?(SKIP_REBASE)
40
41
 
42
+ # Skip the file generated by rails-squash-migrations.
43
+ next if index.zero? && migration_name_base == SQUASHED_MIGRATIONS
44
+
41
45
  if options[:check]
42
46
  index = all_migrations.index(path)
43
47
  if index < starting_index
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-rebase-migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pioneer Valley Books
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.6.7
100
+ rubygems_version: 4.0.3
101
101
  specification_version: 4
102
102
  summary: Rebase Rails migrations to be the latest
103
103
  test_files: []