strong_migrations 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: d55d62155945c43c542203a2d3998d1c4ea5a9d5
4
- data.tar.gz: 4102d8ca2ab624b25c023c631400d920d4ff0602
3
+ metadata.gz: c10a3713f5640ee7249063d3df7236d263cb5a71
4
+ data.tar.gz: df50932fcd76d06f830bafee7a186ac6a5d14c13
5
5
  SHA512:
6
- metadata.gz: c70f45ddaf86e821e8f859d5d953e1633036509d1e613b77ee6720fb884bb1eefb559b9b5c7d2964d3765b84a53c8b0e8ee390097648f674a1d4fbfade216214
7
- data.tar.gz: 5b6161ba4125eaf01c83f8a136af1368452f13022702190c9f5cd2b48487d1c0e6c01871cdfb0568c828deb87da88cc1172daa675b17e4b0c5ea61be82601c04
6
+ metadata.gz: 04b1c12a2dd58c459987a2d3c797cfc225500cb87ece9758b779d049fc62600c1a9b041d35b3e87a0d11000ab05517114ab8960a5003063ad59d7004c5707ba6
7
+ data.tar.gz: 7ac14054e5d67e60bfb75582c164ba9b3360a4a59f135986a665a7c29da3b39feffb0ee40147f142ab6850cf541f117943499ff0748c11ace7474adde5816185
@@ -1,3 +1,7 @@
1
+ ## 0.1.6
2
+
3
+ - Adding an index to a newly created table is now safe
4
+
1
5
  ## 0.1.5
2
6
 
3
7
  - Fixed error with Ruby 2.3 frozen strings
data/README.md CHANGED
@@ -149,7 +149,7 @@ Only dump the schema when adding a new migration. If you use Git, create an init
149
149
 
150
150
  ```ruby
151
151
  ActiveRecord::Base.dump_schema_after_migration = Rails.env.development? &&
152
- !`git status db/migrate/`.include?("working directory clean")
152
+ `git status db/migrate/ --porcelain`.present?
153
153
  ```
154
154
 
155
155
  ## Schema Sanity
@@ -32,7 +32,7 @@ module StrongMigrations
32
32
  raise_error :add_index_columns
33
33
  end
34
34
  options = args[2]
35
- if %w(PostgreSQL PostGIS).include?(connection.adapter_name) && !(options && options[:algorithm] == :concurrently)
35
+ if %w(PostgreSQL PostGIS).include?(connection.adapter_name) && !(options && options[:algorithm] == :concurrently) && !@new_tables.to_a.include?(args[0].to_s)
36
36
  raise_error :add_index
37
37
  end
38
38
  when :add_column
@@ -42,6 +42,8 @@ module StrongMigrations
42
42
  raise_error :add_column_json if type.to_s == "json"
43
43
  when :change_column
44
44
  raise_error :change_column
45
+ when :create_table
46
+ (@new_tables ||= []) << args[0].to_s
45
47
  end
46
48
  end
47
49
 
@@ -1,3 +1,3 @@
1
1
  module StrongMigrations
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Remeika
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-07-24 00:00:00.000000000 Z
13
+ date: 2017-03-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -123,9 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.6.1
126
+ rubygems_version: 2.6.8
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Catch unsafe migrations at dev time
130
130
  test_files: []
131
- has_rdoc: