percona_migrator 0.1.0.rc.3 → 0.1.0.rc.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
  SHA1:
3
- metadata.gz: 7fe6a75f0b0d56a2d50aab13a8a633347e6aaa3a
4
- data.tar.gz: 961dccefa1160b2da61286331390161f6a5a0f65
3
+ metadata.gz: 9e5da0e5e83003f39f3fbfda94fd8ae258d79052
4
+ data.tar.gz: 4ce4629ba354e7d4cd49345ef5298c33caef63e2
5
5
  SHA512:
6
- metadata.gz: 123bdaea1db477acf87c5fbd4f6a48a8a9466efa21fb993f70fc701323d651ebd87a26c595dedebd9b71b01bb8a06fdd8631e146d0c34c2b1a5fa6e6e643bf18
7
- data.tar.gz: 2b84763f317b1f980dc0604bbf44417034b95ae5331ae5bb0636deee98dabdc8f956c9b6090b45922fae15dc27d39d1f327fc2946842a7d4cc8f56ee0c281605
6
+ metadata.gz: 4e1956e97df24759066e4b9ded281074330720274e20a54d6ae07b9b6a64fd292555e2a1a87f7c7ba09752c6c9dc7a0a36016ea6de018de3d8d59211bd718496
7
+ data.tar.gz: 11c8a7816627e264a7bd887e50c454145127519f79de24ff2433af3c77ea42a1326f773781e7748a363da053c3a6098374872a90206d2e5e3dbccb61a747f9db
@@ -6,6 +6,14 @@ Please follow the format in [Keep a Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0.rc.4] - 2016-03-15
10
+
11
+ ### Added
12
+
13
+ - Support #drop_table
14
+ - Support [Foreigner gem](https://github.com/matthuhiggins/foreigner) foreign
15
+ keys in Rails 3 apps that use it.
16
+
9
17
  ## [0.1.0.rc.3] - 2016-03-10
10
18
 
11
19
  ### Added
@@ -43,7 +43,8 @@ module ActiveRecord
43
43
  ADAPTER_NAME = 'Percona'.freeze
44
44
 
45
45
  def_delegators :mysql_adapter, :tables, :select_values, :exec_delete,
46
- :exec_insert, :exec_query, :last_inserted_id, :select, :create_table
46
+ :exec_insert, :exec_query, :last_inserted_id, :select, :create_table,
47
+ :drop_table
47
48
 
48
49
  def initialize(connection, logger, connection_options, config)
49
50
  super
@@ -25,10 +25,21 @@ module PerconaMigrator
25
25
  # @param direction [Symbol] :up or :down
26
26
  def migrate(direction)
27
27
  reconnect_with_percona
28
+ include_foreigner if defined?(Foreigner)
29
+
28
30
  ::Lhm.migration = self
29
31
  original_migrate(direction)
30
32
  end
31
33
 
34
+ # Includes the Foreigner's Mysql2Adapter implemention in
35
+ # PerconaMigratorAdapter to support foreign keys
36
+ def include_foreigner
37
+ Foreigner::Adapter.safe_include(
38
+ :PerconaMigratorAdapter,
39
+ Foreigner::ConnectionAdapters::Mysql2Adapter
40
+ )
41
+ end
42
+
32
43
  # Make all connections in the connection pool to use PerconaAdapter
33
44
  # instead of the current adapter.
34
45
  def reconnect_with_percona
@@ -38,8 +49,8 @@ module PerconaMigrator
38
49
  )
39
50
  end
40
51
 
41
- # It executes the passed statement through the PerconaAdapter if it's
42
- # an alter statement. It uses the mysql adapter otherwise.
52
+ # It executes the passed statement through the PerconaMigratorAdapter
53
+ # if it's an alter statement. It uses the mysql adapter otherwise.
43
54
  #
44
55
  # This is because +pt-online-schema-change+ is intended for alter
45
56
  # statements only.
@@ -1,3 +1,3 @@
1
1
  module PerconaMigrator
2
- VERSION = '0.1.0.rc.3'.freeze
2
+ VERSION = '0.1.0.rc.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percona_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.rc.3
4
+ version: 0.1.0.rc.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Zayats
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-10 00:00:00.000000000 Z
13
+ date: 2016-03-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails