dynamic_migrations 3.6.4 → 3.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffc5194d0e153bdd70a23f5e5b83a3b916d06f1f0b27ea044f9dfab6ef0faa8f
4
- data.tar.gz: 901bf23a5e92dfd68bc45fea4945aa7ac2930b4d7c2d1217196d3b16228076b2
3
+ metadata.gz: d55b74ca5d593d1eb9b5f7709f9f5d5e1de5c2d5d13ef7e3073a68f79ff9d8e3
4
+ data.tar.gz: 8fa0077921bff51558769231e26f050bb6818d908a137e76c1ae566b622216c3
5
5
  SHA512:
6
- metadata.gz: 464de1cbaffead85f9be5bb65c0146984d78c607a95d3ea2ba33293966eb5065f1542867b8667364388e54a06d50a8062919dc512324001b23d1f2fcd4e0ad62
7
- data.tar.gz: 5d30a1b918c09e6d5206e1dd0c0c4963f0b23c0a92b4282c306b9465ed5825f3f0e321c76c274eaa4f465a6f02e907ec1864320ef26f9793e812e9bd0abaea82
6
+ metadata.gz: 588d41a319f45fcfba3c7708adf33edf8b3d1e8adf4f82d222f4fcaf4842b5c98607efa4db7033f8c42df8ab3d9796d32a3f5216634a7b69bd616b022e285d97
7
+ data.tar.gz: 5144499575a152f2251a218b7033c2190d00f247ef5e864215db2b7f1992dd3c21399e65cb102db8d969b8eb08913d2bc0c4d54610f45fd4091b9b3450ee4199
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.6](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.5...v3.6.6) (2023-09-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * column_name and data_type were presented in the wrong order ([e58f8df](https://github.com/craigulliott/dynamic_migrations/commit/e58f8df7d2acabc8a64f760d6ababe218a23928d))
9
+
10
+ ## [3.6.5](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.4...v3.6.5) (2023-09-13)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * setting current schema on the migration class instead of the shared module ([28bc2ca](https://github.com/craigulliott/dynamic_migrations/commit/28bc2ca454883696665804c8596fc3b19ce31bb4))
16
+
3
17
  ## [3.6.4](https://github.com/craigulliott/dynamic_migrations/compare/v3.6.3...v3.6.4) (2023-09-13)
4
18
 
5
19
 
@@ -31,19 +31,24 @@ module DynamicMigrations
31
31
  include Trigger
32
32
  include Enum
33
33
 
34
- # The schema name should be set before the migrations for
35
- # each schema's migrations are run. This is done by:
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
- def self.set_schema_name schema_name
42
- @current_schema = schema_name.to_sym
43
- end
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
- def self.clear_schema_name
46
- @current_schema = nil
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 = Migrators.schema_name
60
+ sn = self.class.schema_name
56
61
  if sn.nil?
57
62
  raise SchemaNameNotSetError
58
63
  end
@@ -120,7 +120,7 @@ module DynamicMigrations
120
120
  "\"#{data_type}\""
121
121
  end
122
122
 
123
- lines << "t.column #{data_type}, :#{column.name}, #{options_syntax}"
123
+ lines << "t.column :#{column.name}, #{data_type}, #{options_syntax}"
124
124
  end
125
125
 
126
126
  if timestamps.any?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicMigrations
4
- VERSION = "3.6.4"
4
+ VERSION = "3.6.6"
5
5
  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.schema_name: -> nil
18
- def self.set_schema_name: (untyped schema_name) -> untyped
19
- def self.clear_schema_name: -> nil
20
- def self.included: (untyped klass) -> untyped
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
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.4
4
+ version: 3.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ulliott