percona_migrator 0.1.0.rc.3 → 0.1.0.rc.4
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9e5da0e5e83003f39f3fbfda94fd8ae258d79052
|
|
4
|
+
data.tar.gz: 4ce4629ba354e7d4cd49345ef5298c33caef63e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e1956e97df24759066e4b9ded281074330720274e20a54d6ae07b9b6a64fd292555e2a1a87f7c7ba09752c6c9dc7a0a36016ea6de018de3d8d59211bd718496
|
|
7
|
+
data.tar.gz: 11c8a7816627e264a7bd887e50c454145127519f79de24ff2433af3c77ea42a1326f773781e7748a363da053c3a6098374872a90206d2e5e3dbccb61a747f9db
|
data/CHANGELOG.md
CHANGED
|
@@ -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
|
|
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.
|
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.
|
|
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-
|
|
13
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rails
|