percona_migrator 0.1.0.rc.1 → 0.1.0.rc.2

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: 54dcba8208db6d98ee85f3124a8b4d725617e80d
4
- data.tar.gz: 86b55bab745a0952886b09aa32323f78db9e8d9f
3
+ metadata.gz: 37474e0d339fdbbf66627f96d152780234101e1b
4
+ data.tar.gz: 399919fee87faf206d71f650e0bc60ff45773d63
5
5
  SHA512:
6
- metadata.gz: 695c5ed29fa887f1f8df33b66ab86a8d63c6fde601e17ff91440f237ec05d62c6e4645128fa144a29dd412b1dbcfa9ef56356e5caa04833d2a88a2ff8ce20200
7
- data.tar.gz: 36d59e8106ceb679b867e90f2d0b1598f17fa74a4eb79d33f73b0c13311ac82a7dd20c990d9a8a711969cec61e1b1de0bbe393205a6a89860569d3248f0515e7
6
+ metadata.gz: d7cbf7b595b676a62582ccf7442aecaadc18ed3378779bd8c0db981b63b8f49a244392be30907c68a2c8a7d8ff93e8ab524f6ad1f12c97155bfaf44eb895225f
7
+ data.tar.gz: 6add69682f7e4cdea9a3cd92b5693413bf54d58302a69600929bc6da7065cb414123bf2c6b4938e93428c049272b93d1034598e2b58de32f6340b7a18d3cf086
data/CHANGELOG.md CHANGED
@@ -5,5 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
  Please follow the format in [Keep a Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
+ ### Added
9
+
10
+ - VERBOSE env var in tests. Specially useful for integration tests.
11
+
12
+ ### Changed
13
+
14
+ - Use ActiveRecord's logger instead of specifying one in the connection data.
15
+
16
+ ## [0.1.0.rc.1] - 2016-03-01
8
17
 
9
18
  - Initial gem version
@@ -12,10 +12,6 @@ module ActiveRecord
12
12
  connection = mysql2_connection(config)
13
13
  client = connection.raw_connection
14
14
 
15
- # TODO: use AR's logger. It must pass a logger instance around, at least
16
- # the one the migration uses
17
- logger = config[:logger] || $stdout
18
-
19
15
  config.merge!(
20
16
  logger: logger,
21
17
  runner: PerconaMigrator::Runner.new(logger),
@@ -34,8 +30,6 @@ module ActiveRecord
34
30
  end
35
31
 
36
32
  module ConnectionAdapters
37
- # It doesn't implement #create_table as this statement is harmless and
38
- # pretty fast. No need to do it with Percona
39
33
  class PerconaMigratorAdapter < AbstractMysqlAdapter
40
34
 
41
35
  class Column < AbstractMysqlAdapter::Column
@@ -49,7 +43,7 @@ module ActiveRecord
49
43
  ADAPTER_NAME = 'Percona'.freeze
50
44
 
51
45
  def_delegators :mysql_adapter, :tables, :select_values, :exec_delete,
52
- :exec_insert, :exec_query, :last_inserted_id, :select
46
+ :exec_insert, :exec_query, :last_inserted_id, :select, :create_table
53
47
 
54
48
  def initialize(connection, logger, connection_options, config)
55
49
  super
@@ -49,7 +49,7 @@ module PerconaMigrator
49
49
  #
50
50
  # Logs when the execution started
51
51
  def log_started
52
- logger.puts "\n#{CYAN}-- #{command}#{NONE}\n\n"
52
+ logger.info "\n#{CYAN}-- #{command}#{NONE}\n\n"
53
53
  end
54
54
 
55
55
  # Executes the command outputing any errors
@@ -58,7 +58,7 @@ module PerconaMigrator
58
58
  def run_command
59
59
  Open3.popen2(command) do |_stdin, stdout, process|
60
60
  @status = process.value
61
- logger.puts stdout.read
61
+ logger.info stdout.read
62
62
  end
63
63
 
64
64
  if status.nil?
@@ -82,7 +82,7 @@ module PerconaMigrator
82
82
 
83
83
  message = value.zero? ? "#{GREEN}Done!#{NONE}" : "#{RED}Failed!#{NONE}"
84
84
 
85
- logger.puts("\n#{message}")
85
+ logger.info("\n#{message}")
86
86
  end
87
87
  end
88
88
  end
@@ -1,3 +1,3 @@
1
1
  module PerconaMigrator
2
- VERSION = '0.1.0.rc.1'.freeze
2
+ VERSION = '0.1.0.rc.2'.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.1
4
+ version: 0.1.0.rc.2
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-01 00:00:00.000000000 Z
13
+ date: 2016-03-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -182,4 +182,3 @@ signing_key:
182
182
  specification_version: 4
183
183
  summary: pt-online-schema-change runner for ActiveRecord migrations
184
184
  test_files: []
185
- has_rdoc: