dynamic_migrations 3.6.10 → 3.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/dynamic_migrations/postgres/generator/enum.rb +2 -2
- data/lib/dynamic_migrations/postgres/generator/trigger.rb +9 -1
- data/lib/dynamic_migrations/postgres/server/database/differences/to_migrations.rb +1 -1
- data/lib/dynamic_migrations/version.rb +1 -1
- data/sig/dynamic_migrations/postgres/generator/validation_template_base.rbs +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: f31ee44c0dced52756c6f563ea8b321b0cbce5d6cd53f7ef7fb796efb5f7e58a
|
4
|
+
data.tar.gz: f3151d84b1574d421d9c122310ce3394f98d4920aa571dc168de2858c91cdc7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c090b0758ed52dd8b21a5327e83f6d41f23afc5ad3c53bf265166a85245738c37c5188b15dfed27bb890b36db62896590c7dea3fc8d80e130120d43bd548e560
|
7
|
+
data.tar.gz: 74eb4c9ad0d25987f588ccdc0239e460bbc7169a82cec5fc7c837077e822570ac11d61ae7a136a27f49a5c7093c2e91100d22dd3247729bbbb63fd9c316e19f2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [3.6.11](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.10...v3.6.11) (2023-09-13)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* injecting dependent_function into templated triggers ([9e770a3](https://github.com/craigulliott/dynamic_migrations/commit/9e770a352b176c7b10471e9185ac01feca538c0c))
|
9
|
+
* writing enums to the migration files as arrays of strings for more compatibility with special characters ([1910e0f](https://github.com/craigulliott/dynamic_migrations/commit/1910e0f709e5bd560696c2e2b3bd729c7a61e319))
|
10
|
+
|
3
11
|
## [3.6.10](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.9...v3.6.10) (2023-09-13)
|
4
12
|
|
5
13
|
|
@@ -21,7 +21,7 @@ module DynamicMigrations
|
|
21
21
|
code_comment: code_comment,
|
22
22
|
migration: <<~RUBY
|
23
23
|
create_enum :#{enum.name}, [
|
24
|
-
|
24
|
+
"#{enum.values.join("\",\n \"")}"
|
25
25
|
]
|
26
26
|
RUBY
|
27
27
|
end
|
@@ -40,7 +40,7 @@ module DynamicMigrations
|
|
40
40
|
code_comment: code_comment,
|
41
41
|
migration: <<~RUBY
|
42
42
|
add_enum_values :#{updated_enum.name}, [
|
43
|
-
|
43
|
+
"#{added_values.join("\",\n \"")}"
|
44
44
|
]
|
45
45
|
RUBY
|
46
46
|
end
|
@@ -32,7 +32,15 @@ module DynamicMigrations
|
|
32
32
|
end
|
33
33
|
|
34
34
|
arguments = template_class.new(trigger, code_comment).fragment_arguments
|
35
|
-
|
35
|
+
|
36
|
+
# we only provide a dependent function if the function has more than one trigger
|
37
|
+
# or is in a different schema, otherwise it is added to the same migration as this
|
38
|
+
# trigger and we don't need to worry about dependencies
|
39
|
+
if trigger.function && (trigger.function.triggers.count > 1 || trigger.table.schema != trigger.function.schema)
|
40
|
+
add_fragment(dependent_function: trigger.function, **arguments)
|
41
|
+
else
|
42
|
+
add_fragment(**arguments)
|
43
|
+
end
|
36
44
|
|
37
45
|
# no template, process this as a default trigger (takes all options)
|
38
46
|
else
|
@@ -50,7 +50,7 @@ module DynamicMigrations
|
|
50
50
|
process_schema schema_name, differences[:configuration][:schemas][schema_name], differences[:database][:schemas][schema_name]
|
51
51
|
end
|
52
52
|
|
53
|
-
# return the migrations
|
53
|
+
# return the migrations (they are sorted via a dependency algorithm)
|
54
54
|
@generator.migrations
|
55
55
|
end
|
56
56
|
|
@@ -12,7 +12,7 @@ module DynamicMigrations
|
|
12
12
|
def initialize: (untyped validation, untyped code_comment) -> void
|
13
13
|
|
14
14
|
# abstract method (should actually be added to child classes)
|
15
|
-
def fragment_arguments: -> {schema: Postgres::Server::Database::Schema, table: Postgres::Server::Database::Schema::Table, migration_method:
|
15
|
+
def fragment_arguments: -> {schema: Postgres::Server::Database::Schema, table: Postgres::Server::Database::Schema::Table, migration_method: Symbol, object: untyped, code_comment: String?, migration: String, dependent_function: Postgres::Server::Database::Schema::Function?}
|
16
16
|
|
17
17
|
private
|
18
18
|
def assert_not_deferred!: -> nil
|