seed-snapshot 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/seed/configuration.rb +4 -0
- data/lib/seed/mysql.rb +10 -2
- data/lib/seed/snapshot.rb +2 -1
- data/lib/seed_snapshot/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0e7df0e9d35515b67d89e5575e97ff66126d53b23fd1ebe9fa7c00cc5ce4e76
|
4
|
+
data.tar.gz: 3e4322ce3ebcfa46e0fb167e13cd768ad1705e27a2c3f2e9c30dd0121584f6fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94d21e022bda2990d59e218fdb8fb17df37204e10e9749d0c174e593f61c81086f0dc7d64948bcacda25841192089183b193c6675bd9a85a40f306034e5f78a2
|
7
|
+
data.tar.gz: edf2b22be083d56af3f0eb3724009841bb791e42022d57523dd292d1b119bd0b83097b23a1d013de7ad763ac3990a58918483fd307b56e32b3183e3592d4adcc
|
data/lib/seed/configuration.rb
CHANGED
@@ -16,6 +16,10 @@ module Seed
|
|
16
16
|
@schema_version ||= Digest::SHA1.hexdigest(get_all_versions.sort.join)
|
17
17
|
end
|
18
18
|
|
19
|
+
def client_version
|
20
|
+
@client_version ||= ActiveRecord::Base.connection.raw_connection.info[:version]
|
21
|
+
end
|
22
|
+
|
19
23
|
def database_options
|
20
24
|
@options ||= ActiveRecord::Base.connection.raw_connection.query_options
|
21
25
|
end
|
data/lib/seed/mysql.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
module Seed
|
2
2
|
class Mysql
|
3
|
-
def self.dump(file_path, username:, password:, host:, port:, database:, tables:, ignore_tables:)
|
3
|
+
def self.dump(file_path, username:, password:, host:, port:, database:, tables:, ignore_tables:, client_version:)
|
4
4
|
host = 'localhost' unless host
|
5
|
-
|
5
|
+
|
6
|
+
additional_options =
|
7
|
+
if client_version.match?(/\A8/)
|
8
|
+
'--skip-column-statistics'
|
9
|
+
else
|
10
|
+
''
|
11
|
+
end
|
12
|
+
|
13
|
+
cmd = "MYSQL_PWD=#{password} mysqldump -u #{username} -h #{host} #{database} -t #{allow_tables_option(tables)} #{ignore_tables_option(ignore_tables)} --no-tablespaces #{additional_options} > #{file_path}"
|
6
14
|
system cmd
|
7
15
|
end
|
8
16
|
|
data/lib/seed/snapshot.rb
CHANGED
@@ -16,7 +16,8 @@ module Seed
|
|
16
16
|
@configuration.current_version_path,
|
17
17
|
options.merge({
|
18
18
|
tables: tables(classes),
|
19
|
-
ignore_tables: ignore_tables(ignore_classes)
|
19
|
+
ignore_tables: ignore_tables(ignore_classes),
|
20
|
+
client_version: @configuration.client_version
|
20
21
|
})
|
21
22
|
)
|
22
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seed-snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yo_waka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.0.3
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Easy dump/restore tool for ActiveRecord.
|