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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a38d42c4c3dc9dc9f23ffffdf6ec7fa50666dde4dca15183d927a553e73ed34
4
- data.tar.gz: 2bdf6269144963eac3c1eb31baf98612ffd9a102907b1fe4a79a105e5e8b38a3
3
+ metadata.gz: 01e5bf6fb9d9a79f31d499115c92f7c09c2df3528dc8431a4fb6a4befe594d3f
4
+ data.tar.gz: 3f4d63741bcbfecde1b6b2232db4e1091559882372c61131395b83d65eeabade
5
5
  SHA512:
6
- metadata.gz: ae7126ada97170c8b9a10483ccaec6a55f1d36081644bb1105c1234ae3e4e8f205da2c8bbd2b9b282e4693bd6e52b88b5ec28ced88ff3e24cf0bebef8e5eb23f
7
- data.tar.gz: b71a7e65f81191282f4bb6502a4311ebba5bcc858088b9256035efbb52863d9146de9a6dd3b463a4da348dc07ccc1662b2adb7adcdbab4d654d410ced3317d6b
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", "--single-transaction", "--no-data", "--set-gtid-purged=OFF",
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", "--single-transaction", "--set-gtid-purged=OFF",
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(',')})"
@@ -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
- enhance("#{namespace}:#{name}", "db:structure:dump", "app:db:structure:dump", "db:schema:dump",
62
- "app:db:schema:dump")
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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Edgestitch
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edgestitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Palhares