dynamic_migrations 3.6.4 → 3.6.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fc1e5f220706376e73d84dc6f78acbb549f745a45c70d89e8335f540e44ef5f
|
4
|
+
data.tar.gz: 5532ce24fbcc66d9d0eeb765b686f303af60e871ae371437953d88170ea51898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf89b66978b604919aaf1892df850a8679d611d4052ec904970fd0859879fefb3ae0878159243af80ec4b2484207a29f74248a44487baa3c27fafa6b5c51cba
|
7
|
+
data.tar.gz: 367a8f6fff5a9a5e869c8720e662745d755972e225e0145001b4126856c45e2ad75e9e783a2277590932abac2b39db42305abed509dda51c7c0dbed4a4e85d7b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [3.6.5](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.4...v3.6.5) (2023-09-13)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* setting current schema on the migration class instead of the shared module ([28bc2ca](https://github.com/craigulliott/dynamic_migrations/commit/28bc2ca454883696665804c8596fc3b19ce31bb4))
|
9
|
+
|
3
10
|
## [3.6.4](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.3...v3.6.4) (2023-09-13)
|
4
11
|
|
5
12
|
|
@@ -31,19 +31,24 @@ module DynamicMigrations
|
|
31
31
|
include Trigger
|
32
32
|
include Enum
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
# DynamicMigrations::ActiveRecord::Migrators.set_schema_name :schema_name
|
37
|
-
def self.schema_name
|
38
|
-
@current_schema
|
34
|
+
def self.included(base)
|
35
|
+
base.extend(ClassMethods)
|
39
36
|
end
|
40
37
|
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
module ClassMethods
|
39
|
+
# The schema name should be set on the migration class before the migration
|
40
|
+
# is run
|
41
|
+
def schema_name
|
42
|
+
@current_schema
|
43
|
+
end
|
44
44
|
|
45
|
-
|
46
|
-
|
45
|
+
def set_schema_name schema_name
|
46
|
+
@current_schema = schema_name.to_sym
|
47
|
+
end
|
48
|
+
|
49
|
+
def clear_schema_name
|
50
|
+
@current_schema = nil
|
51
|
+
end
|
47
52
|
end
|
48
53
|
|
49
54
|
def quote string
|
@@ -52,7 +57,7 @@ module DynamicMigrations
|
|
52
57
|
|
53
58
|
# this method is made available on the final migration class
|
54
59
|
def schema_name
|
55
|
-
sn =
|
60
|
+
sn = self.class.schema_name
|
56
61
|
if sn.nil?
|
57
62
|
raise SchemaNameNotSetError
|
58
63
|
end
|
@@ -1,11 +1,6 @@
|
|
1
|
-
# TypeProf 0.21.7
|
2
|
-
|
3
|
-
# Classes
|
4
1
|
module DynamicMigrations
|
5
2
|
module ActiveRecord
|
6
3
|
module Migrators
|
7
|
-
self.@current_schema: nil
|
8
|
-
|
9
4
|
include Validation
|
10
5
|
include ForeignKeyConstraint
|
11
6
|
include Column
|
@@ -14,11 +9,10 @@ module DynamicMigrations
|
|
14
9
|
include Function
|
15
10
|
include Trigger
|
16
11
|
|
17
|
-
def self.
|
18
|
-
def
|
19
|
-
def
|
20
|
-
def self.
|
21
|
-
def schema_name: -> nil
|
12
|
+
def self.included: (untyped base) -> void
|
13
|
+
def quote: (untyped string) -> String
|
14
|
+
def schema_name: -> Symbol
|
15
|
+
def self.schema_name: -> Symbol
|
22
16
|
|
23
17
|
# this methods comes from active record once the module has been included
|
24
18
|
def connection: -> untyped
|
@@ -31,6 +25,14 @@ module DynamicMigrations
|
|
31
25
|
|
32
26
|
class MissingFunctionBlockError < StandardError
|
33
27
|
end
|
28
|
+
|
29
|
+
module ClassMethods
|
30
|
+
@current_schema: Symbol?
|
31
|
+
|
32
|
+
def schema_name: -> Symbol?
|
33
|
+
def set_schema_name: (untyped schema_name) -> void
|
34
|
+
def clear_schema_name: -> void
|
35
|
+
end
|
34
36
|
end
|
35
37
|
end
|
36
38
|
end
|