activerecord-safer_migrations 1.0.0 → 2.0.0

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: d5bbd70be93d0f635e3c8deedb66ab57339497ed
4
- data.tar.gz: ab6d3074032be9a7861f766a70118b7c6472744f
3
+ metadata.gz: 22edc1b74891b126918870a164f1213a79e92627
4
+ data.tar.gz: 153a817bf13c44c28a22ba7048756e4d61dcaf43
5
5
  SHA512:
6
- metadata.gz: 6c7b9a3ec03145bc9fc37c8e1fe03d999756fbf77953c59f83fcc222dc021fc70ef83d0023a5dc6123595fd92abea7397aa50feaca9dc2b50a0494bf2b979222
7
- data.tar.gz: 04a96fd6b38c2624f138ec3cdcc6c6bfe6a89423c7a4564066f07223e6d7c3f3168db849c31f118cdf31223a1fce35a3dfae177054176ad73891188bca61d755
6
+ metadata.gz: 5cd1cfa6177e67981bf0060740d899504ab15945f59e48627b7053450483fd50bd7bbeaac137ef1410ac30b5c35a07b6d86935114b469d7902519875711c9e78
7
+ data.tar.gz: 75866edc3cfb0eac725953860a47f80f72212803b5f40f49cd62cc474720da6b13e83b882dfccc78f5b6b3e88369126a36a460ea45b080bb65a1b95cca4b9157
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p353
1
+ 2.4.1
data/.travis.yml CHANGED
@@ -1,10 +1,9 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.3.0
5
- - 2.2.4
6
- - 2.1
7
- - 2.0.0
4
+ - 2.4.1
5
+ - 2.3.4
6
+ - 2.2.6
8
7
 
9
8
  addons:
10
9
  postgresql: "9.3"
@@ -20,14 +19,6 @@ env:
20
19
  global:
21
20
  - "DATABASE_URL=postgres://postgres@localhost/safer_migrations_test"
22
21
  matrix:
23
- - "ACTIVERECORD_VERSION=4.0.13"
24
- - "ACTIVERECORD_VERSION=4.1.10"
25
- - "ACTIVERECORD_VERSION=4.2.2"
26
- - "ACTIVERECORD_VERSION=5.0.0.rc1"
27
-
28
- matrix:
29
- exclude:
30
- - rvm: 2.1
31
- env: "ACTIVERECORD_VERSION=5.0.0.rc1"
32
- - rvm: 2.0.0
33
- env: "ACTIVERECORD_VERSION=5.0.0.rc1"
22
+ - "ACTIVERECORD_VERSION=4.2.9"
23
+ - "ACTIVERECORD_VERSION=5.0.5"
24
+ - "ACTIVERECORD_VERSION=5.1.3"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 2.0.0 / 2017-08-23
2
+
3
+ - [#23](https://github.com/gocardless/activerecord-safer_migrations/pull/23) Drop support for Rails 4.0 and 4.1
4
+ - [#24](https://github.com/gocardless/activerecord-safer_migrations/pull/24) Drop support for Ruby 2.0 and 2.1, add Ruby 2.4
5
+
1
6
  # 1.0.0 / 2016-05-09
2
7
 
3
8
  - Support for Rails 5
data/Gemfile CHANGED
@@ -3,9 +3,3 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem "activerecord", "~> #{ENV['ACTIVERECORD_VERSION']}" if ENV["ACTIVERECORD_VERSION"]
6
-
7
- group :development do
8
- gem "pg", "~> 0.18.3"
9
- gem "rspec", "~> 3.3.0"
10
- gem "rubocop", "~> 0.35.1"
11
- end
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ## ActiveRecord safer migration helpers
2
2
 
3
+ > Looking for Rails 4.0 or Ruby 2.0 support? Please check out the [1.x tree](https://github.com/gocardless/activerecord-safer_migrations/tree/v1.0.0).
4
+
3
5
  *Note: this library only supports PostgreSQL 9.3+. If you're interested in adding support for other databases, we're open to pull requests!*
4
6
 
5
7
  Postgres holds ACCESS EXCLUSIVE locks for [almost all][pg-alter-table] DDL
@@ -8,7 +10,7 @@ which can cause issues in several situations. For instance:
8
10
 
9
11
  1. If the lock is held for a long time, all other access to the table will be
10
12
  blocked, which can result in downtime.
11
- 2. Even if the lock is only held breifly, it will block all other access to the
13
+ 2. Even if the lock is only held briefly, it will block all other access to the
12
14
  table while it is in the lock queue, as it conflicts with all other locks.
13
15
  The lock can't be acquired until all other queries ahead of it have finished,
14
16
  so having to wait on long-running queries can also result in downtime.
@@ -12,5 +12,11 @@ Gem::Specification.new do |gem|
12
12
  gem.homepage = "https://github.com/gocardless/activerecord-safer_migrations"
13
13
  gem.license = "MIT"
14
14
 
15
+ gem.required_ruby_version = "~> 2.2"
16
+
15
17
  gem.add_runtime_dependency "activerecord", ">= 4.0"
18
+
19
+ gem.add_development_dependency "pg", "~> 0.21.0"
20
+ gem.add_development_dependency "rspec", "~> 3.3.0"
21
+ gem.add_development_dependency "rubocop", "~> 0.35.1"
16
22
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module SaferMigrations
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "2.0.0".freeze
4
4
  end
5
5
  end
@@ -1,6 +1,14 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe ActiveRecord::SaferMigrations::Migration do
4
+ let(:migration_base_class) do
5
+ if ActiveRecord.version >= Gem::Version.new("5.0")
6
+ ActiveRecord::Migration[ActiveRecord::Migration.current_version]
7
+ else
8
+ ActiveRecord::Migration
9
+ end
10
+ end
11
+
4
12
  before { nuke_migrations }
5
13
  before { TimeoutTestHelpers.set(:lock_timeout, 0) }
6
14
  before { TimeoutTestHelpers.set(:statement_timeout, 0) }
@@ -11,7 +19,7 @@ RSpec.describe ActiveRecord::SaferMigrations::Migration do
11
19
 
12
20
  shared_examples_for "running the migration" do
13
21
  let(:migration) do
14
- Class.new(ActiveRecord::Migration) do
22
+ Class.new(migration_base_class) do
15
23
  set_lock_timeout(5000)
16
24
  set_statement_timeout(5001)
17
25
 
@@ -79,7 +87,7 @@ RSpec.describe ActiveRecord::SaferMigrations::Migration do
79
87
  before { ActiveRecord::SaferMigrations.default_lock_timeout = 6000 }
80
88
  before { ActiveRecord::SaferMigrations.default_statement_timeout = 6001 }
81
89
  let(:migration) do
82
- Class.new(ActiveRecord::Migration) do
90
+ Class.new(migration_base_class) do
83
91
  def change
84
92
  $lock_timeout = TimeoutTestHelpers.get(:lock_timeout)
85
93
  $statement_timeout = TimeoutTestHelpers.get(:statement_timeout)
@@ -114,7 +122,7 @@ RSpec.describe ActiveRecord::SaferMigrations::Migration do
114
122
  before { ActiveRecord::SaferMigrations.default_lock_timeout = 6000 }
115
123
  before { ActiveRecord::SaferMigrations.default_statement_timeout = 6001 }
116
124
  let(:base_migration) do
117
- Class.new(ActiveRecord::Migration) do
125
+ Class.new(migration_base_class) do
118
126
  set_lock_timeout(7000)
119
127
  set_statement_timeout(7001)
120
128
  def change
metadata CHANGED
@@ -1,39 +1,81 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-safer_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pg
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.21.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.21.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.3.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.3.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.35.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.35.1
27
69
  description: ''
28
70
  email: developers@gocardless.com
29
71
  executables: []
30
72
  extensions: []
31
73
  extra_rdoc_files: []
32
74
  files:
33
- - .gitignore
34
- - .rubocop.yml
35
- - .ruby-version
36
- - .travis.yml
75
+ - ".gitignore"
76
+ - ".rubocop.yml"
77
+ - ".ruby-version"
78
+ - ".travis.yml"
37
79
  - CHANGELOG.md
38
80
  - Gemfile
39
81
  - LICENSE.txt
@@ -57,17 +99,17 @@ require_paths:
57
99
  - lib
58
100
  required_ruby_version: !ruby/object:Gem::Requirement
59
101
  requirements:
60
- - - '>='
102
+ - - "~>"
61
103
  - !ruby/object:Gem::Version
62
- version: '0'
104
+ version: '2.2'
63
105
  required_rubygems_version: !ruby/object:Gem::Requirement
64
106
  requirements:
65
- - - '>='
107
+ - - ">="
66
108
  - !ruby/object:Gem::Version
67
109
  version: '0'
68
110
  requirements: []
69
111
  rubyforge_project:
70
- rubygems_version: 2.0.14
112
+ rubygems_version: 2.6.11
71
113
  signing_key:
72
114
  specification_version: 4
73
115
  summary: ActiveRecord migration helpers to avoid downtime