dynamic_migrations 3.6.0 → 3.6.2

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: a25d76d54d7129a77f16574c4b6a84cf82ca6105afe4279ba868b34b97fa4814
4
- data.tar.gz: b60f87c21dd0e53aed9853d4eaece239cab1d2524ba9c500e3dc364eda1d40dd
3
+ metadata.gz: 5a237bb66c7567c302f4f01ada5c06be36187234cd430da63a753eac9c3c0320
4
+ data.tar.gz: ab87c5f523b6a682a4e6b648b050e609fe1bfca14bcf1fdebd813b04a5f5091b
5
5
  SHA512:
6
- metadata.gz: ef75931965eb2dd877bd22a82b4ad6532df5ab4e9e5ff24cc160f9fcc81c3c1db7eca2698b30da99a29000c7c67cf4efd1f5d7eca8ff28fbcc31631a0d43225b
7
- data.tar.gz: 4d4218e2872b79b68b79517696403f3aa15c1b87ac2c9b8afd47e1ebb4a1fcb1b3e3efbd0f0db61ad788e8c80472b2eef1d389e08dbf0153414dcfecab5b976c
6
+ metadata.gz: 94080c180556da70c9bba292ec6de10de980ed95ff71705c14b320a56b507eae50cccbc1654354184406bce6386b03bde27afdae2615c8060818f8ab5f876bc1
7
+ data.tar.gz: e1800b2c149556be65affbf35321abd7f50282efe54dcb33af379cc24ea493c7c72663eff1b7e4379eef4ac8eb852b5a36f8532f844ebc7eadb6784b495e62ff
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.2](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.1...v3.6.2) (2023-09-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * don't generate columns separately for migrations if also generating the table (as they are already included in the table definition) ([b6f748c](https://github.com/craigulliott/dynamic_migrations/commit/b6f748c8e72aaab12d32243f6a007d03707041da))
9
+
10
+ ## [3.6.1](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.0...v3.6.1) (2023-09-13)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * adding attr_reader for :code_comment to provide easier access within migration templates ([b805e24](https://github.com/craigulliott/dynamic_migrations/commit/b805e247ef42ea4dd62973be07057d6e110876a3))
16
+
3
17
  ## [3.6.0](https://github.com/craigulliott/dynamic_migrations/compare/v3.5.3...v3.6.0) (2023-09-13)
4
18
 
5
19
 
@@ -6,6 +6,7 @@ module DynamicMigrations
6
6
  end
7
7
 
8
8
  attr_reader :trigger
9
+ attr_reader :code_comment
9
10
 
10
11
  def initialize trigger, code_comment
11
12
  @trigger = trigger
@@ -6,6 +6,7 @@ module DynamicMigrations
6
6
  end
7
7
 
8
8
  attr_reader :validation
9
+ attr_reader :code_comment
9
10
 
10
11
  def initialize validation, code_comment
11
12
  @validation = validation
@@ -26,7 +26,7 @@ module DynamicMigrations
26
26
 
27
27
  # we process everything else after we create the table, because the other
28
28
  # database objects are dependent on the table
29
- process_dependents schema_name, table_name, configuration_table, {}
29
+ process_dependents schema_name, table_name, configuration_table, {}, skip_columns: true
30
30
 
31
31
  # If the schema exists in the database but not in the configuration
32
32
  # then we need to delete it.
@@ -60,8 +60,11 @@ module DynamicMigrations
60
60
  end
61
61
  end
62
62
 
63
- def process_dependents schema_name, table_name, configuration_table, database_table
64
- process_columns schema_name, table_name, configuration_table[:columns] || {}, database_table[:columns] || {}
63
+ def process_dependents schema_name, table_name, configuration_table, database_table, skip_columns: false
64
+ # we skip columns if we are processing the table for the first time, as they are processed within the table creation
65
+ unless skip_columns
66
+ process_columns schema_name, table_name, configuration_table[:columns] || {}, database_table[:columns] || {}
67
+ end
65
68
  process_foreign_key_constraints schema_name, table_name, configuration_table[:foreign_key_constraints] || {}, database_table[:foreign_key_constraints] || {}
66
69
  process_indexes schema_name, table_name, configuration_table[:indexes] || {}, database_table[:indexes] || {}
67
70
  process_triggers schema_name, table_name, configuration_table[:triggers] || {}, database_table[:triggers] || {}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicMigrations
4
- VERSION = "3.6.0"
4
+ VERSION = "3.6.2"
5
5
  end
@@ -3,9 +3,9 @@ module DynamicMigrations
3
3
  module Postgres
4
4
  class Generator
5
5
  class TriggerTemplateBase
6
- @code_comment: untyped
7
6
 
8
7
  attr_reader trigger: untyped
8
+ attr_reader code_comment: String?
9
9
 
10
10
  def initialize: (untyped trigger, untyped code_comment) -> void
11
11
 
@@ -5,9 +5,9 @@ module DynamicMigrations
5
5
  module Postgres
6
6
  class Generator
7
7
  class ValidationTemplateBase
8
- @code_comment: untyped
9
8
 
10
9
  attr_reader validation: untyped
10
+ attr_reader code_comment: String?
11
11
 
12
12
  def initialize: (untyped validation, untyped code_comment) -> void
13
13
 
@@ -14,7 +14,7 @@ module DynamicMigrations
14
14
  def process_tables: (Symbol schema_name, untyped configuration_tables, untyped database_tables) -> void
15
15
  def process_table: (Symbol schema_name, Symbol table_name, untyped configuration_table, untyped database_table) -> void
16
16
  # this method comes from the Columns module
17
- def process_dependents: (Symbol schema_name, Symbol table_name, untyped configuration_columns, untyped database_columns) -> void
17
+ def process_dependents: (Symbol schema_name, Symbol table_name, untyped configuration_columns, untyped database_columns, ?skip_columns: bool) -> void
18
18
  def process_columns: (Symbol schema_name, Symbol table_name, untyped configuration_columns, untyped database_columns) -> void
19
19
  def process_foreign_key_constraints: (Symbol schema_name, Symbol table_name, untyped configuration_foreign_key_constraints, untyped database_foreign_key_constraints) -> void
20
20
  def process_indexes: (Symbol schema_name, Symbol table_name, untyped configuration_indexes, untyped database_indexes) -> void
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott