edgestitch 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/edgestitch/mysql/dump.rb +2 -2
- data/lib/edgestitch/tasks.rb +10 -5
- data/lib/edgestitch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01e5bf6fb9d9a79f31d499115c92f7c09c2df3528dc8431a4fb6a4befe594d3f
|
4
|
+
data.tar.gz: 3f4d63741bcbfecde1b6b2232db4e1091559882372c61131395b83d65eeabade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd180eb4d4f2a45f028708f660f2cb16387f1a04871e84c270d4d9397069e91cf0555540fe6a85a073ac7e0aa9393ee4e67131f141e73a3de387d18478e3ac8
|
7
|
+
data.tar.gz: 0e1cc6cad4f9cc428236c51ddee089642237ecf8d33e4dce289fb24a4d068d4c88a49d6afa2bab92fca3b71721a7fecef01a46986ec20d24f9e5bc85e155e7a6
|
@@ -50,7 +50,7 @@ module Edgestitch
|
|
50
50
|
return if tables.empty?
|
51
51
|
|
52
52
|
self.class.sanitize_sql(
|
53
|
-
execute("--compact", "--skip-lock-tables", "--
|
53
|
+
execute("--compact", "--skip-lock-tables", "--no-data", "--set-gtid-purged=OFF",
|
54
54
|
"--column-statistics=0", *tables)
|
55
55
|
)
|
56
56
|
end
|
@@ -66,7 +66,7 @@ module Edgestitch
|
|
66
66
|
def export_migrations(migrations)
|
67
67
|
migrations.in_groups_of(50, false).map do |versions|
|
68
68
|
execute(
|
69
|
-
"--compact", "--skip-lock-tables", "--
|
69
|
+
"--compact", "--skip-lock-tables", "--set-gtid-purged=OFF",
|
70
70
|
"--no-create-info", "--column-statistics=0",
|
71
71
|
"schema_migrations",
|
72
72
|
"-w", "version IN (#{versions.join(',')})"
|
data/lib/edgestitch/tasks.rb
CHANGED
@@ -31,9 +31,11 @@ module Edgestitch
|
|
31
31
|
# - db:schema:load
|
32
32
|
#
|
33
33
|
# @param namespace [String] namespace where the task will run [default: db:stitch]
|
34
|
+
# @param enhance_rails [Boolean] whether edgestitch should enhance the above tasks or not [default: true]
|
34
35
|
# @return [Rake::Task]
|
35
|
-
def define_stitch(namespace = "db:stitch")
|
36
|
-
enhance(namespace, "db:prepare", "db:structure:load", "db:schema:load")
|
36
|
+
def define_stitch(namespace = "db:stitch", enhance_rails: true)
|
37
|
+
enhance(namespace, "db:prepare", "db:structure:load", "db:schema:load") if enhance_rails
|
38
|
+
|
37
39
|
desc "Create structure.sql for an app based on all loaded engines' structure-self.sql"
|
38
40
|
task namespace => [:environment] do |_task, _args|
|
39
41
|
ActiveRecord::Base.configurations.configs_for(env_name: Rails.env).each do |db_config|
|
@@ -56,10 +58,13 @@ module Edgestitch
|
|
56
58
|
# @param engine [Class<Rails::Engine>] target class of the task
|
57
59
|
# @param namespace [String] the namespace where the target will be generated [default: db:stitch]
|
58
60
|
# @param name [String] the name of the task within the given namespace [default: engine.engine_name]
|
61
|
+
# @param enhance_rails [Boolean] whether edgestitch should enhance the above tasks or not [default: true]
|
59
62
|
# @return [Rake::Task]
|
60
|
-
def define_engine(engine, namespace: "db:stitch", name: engine.engine_name)
|
61
|
-
|
62
|
-
|
63
|
+
def define_engine(engine, namespace: "db:stitch", name: engine.engine_name, enhance_rails: true) # rubocop:disable Metrics/MethodLength
|
64
|
+
if enhance_rails
|
65
|
+
enhance("#{namespace}:#{name}", "db:structure:dump", "app:db:structure:dump", "db:schema:dump",
|
66
|
+
"app:db:schema:dump")
|
67
|
+
end
|
63
68
|
|
64
69
|
desc "Create structure-self.sql for an engine"
|
65
70
|
task "#{namespace}:#{name}" => [:environment] do |_, _args|
|
data/lib/edgestitch/version.rb
CHANGED