dynamic_migrations 3.4.1 → 3.5.0

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.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/lib/dynamic_migrations/active_record/migrators/foreign_key_constraint.rb +14 -14
  4. data/lib/dynamic_migrations/postgres/generator/extension.rb +2 -2
  5. data/lib/dynamic_migrations/postgres/generator/migration.rb +2 -2
  6. data/lib/dynamic_migrations/version.rb +1 -1
  7. data/sig/dynamic_migrations/active_record/migrators/column.rbs +18 -0
  8. data/sig/dynamic_migrations/active_record/migrators/enum.rbs +22 -0
  9. data/sig/dynamic_migrations/active_record/migrators/foreign_key_constraint.rbs +29 -0
  10. data/sig/dynamic_migrations/active_record/migrators/function.rbs +28 -0
  11. data/sig/dynamic_migrations/active_record/migrators/index.rbs +17 -0
  12. data/sig/dynamic_migrations/active_record/migrators/schema.rbs +17 -0
  13. data/sig/dynamic_migrations/active_record/migrators/table.rbs +18 -0
  14. data/sig/dynamic_migrations/active_record/migrators/trigger.rbs +32 -0
  15. data/sig/dynamic_migrations/active_record/migrators/unique_constraint.rbs +20 -0
  16. data/sig/dynamic_migrations/active_record/migrators/validation.rbs +24 -0
  17. data/sig/dynamic_migrations/active_record/migrators.rbs +37 -0
  18. data/sig/dynamic_migrations/expected_boolean_error.rbs +4 -0
  19. data/sig/dynamic_migrations/expected_integer_error.rbs +4 -0
  20. data/sig/dynamic_migrations/expected_string_error.rbs +4 -0
  21. data/sig/dynamic_migrations/expected_symbol_error.rbs +4 -0
  22. data/sig/dynamic_migrations/invalid_source_error.rbs +5 -0
  23. data/sig/dynamic_migrations/module_included_into_unexpected_target_error.rbs +7 -0
  24. data/sig/dynamic_migrations/name_helper.rbs +5 -0
  25. data/sig/dynamic_migrations/postgres/connections.rbs +12 -0
  26. data/sig/dynamic_migrations/postgres/generator/column.rbs +24 -0
  27. data/sig/dynamic_migrations/postgres/generator/database_migration.rbs +12 -0
  28. data/sig/dynamic_migrations/postgres/generator/enum.rbs +23 -0
  29. data/sig/dynamic_migrations/postgres/generator/extension.rbs +16 -0
  30. data/sig/dynamic_migrations/postgres/generator/foreign_key_constraint.rbs +21 -0
  31. data/sig/dynamic_migrations/postgres/generator/fragment.rbs +32 -0
  32. data/sig/dynamic_migrations/postgres/generator/function.rbs +21 -0
  33. data/sig/dynamic_migrations/postgres/generator/index.rbs +21 -0
  34. data/sig/dynamic_migrations/postgres/generator/migration.rbs +58 -0
  35. data/sig/dynamic_migrations/postgres/generator/migration_dependency_sorter.rbs +12 -0
  36. data/sig/dynamic_migrations/postgres/generator/primary_key.rbs +20 -0
  37. data/sig/dynamic_migrations/postgres/generator/schema.rbs +17 -0
  38. data/sig/dynamic_migrations/postgres/generator/schema_migration.rbs +13 -0
  39. data/sig/dynamic_migrations/postgres/generator/table.rbs +30 -0
  40. data/sig/dynamic_migrations/postgres/generator/table_migration.rbs +12 -0
  41. data/sig/dynamic_migrations/postgres/generator/trigger.rbs +22 -0
  42. data/sig/dynamic_migrations/postgres/generator/unique_constraint.rbs +21 -0
  43. data/sig/dynamic_migrations/postgres/generator/validation.rbs +21 -0
  44. data/sig/dynamic_migrations/postgres/generator.rbs +57 -0
  45. data/sig/dynamic_migrations/postgres/server/database/configured_extensions.rbs +18 -0
  46. data/sig/dynamic_migrations/postgres/server/database/configured_schemas.rbs +23 -0
  47. data/sig/dynamic_migrations/postgres/server/database/connection.rbs +29 -0
  48. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/extensions.rbs +22 -0
  49. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/enums.rbs +24 -0
  50. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/functions.rbs +24 -0
  51. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/columns.rbs +26 -0
  52. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/foreign_key_constraints.rbs +26 -0
  53. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/indexes.rbs +26 -0
  54. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/primary_key.rbs +25 -0
  55. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/triggers.rbs +26 -0
  56. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/unique_constraints.rbs +26 -0
  57. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/validations.rbs +26 -0
  58. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables.rbs +33 -0
  59. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas.rbs +30 -0
  60. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations.rbs +47 -0
  61. data/sig/dynamic_migrations/postgres/server/database/differences.rbs +54 -0
  62. data/sig/dynamic_migrations/postgres/server/database/enums_loader.rbs +18 -0
  63. data/sig/dynamic_migrations/postgres/server/database/extensions_loader.rbs +17 -0
  64. data/sig/dynamic_migrations/postgres/server/database/keys_and_unique_constraints_loader.rbs +15 -0
  65. data/sig/dynamic_migrations/postgres/server/database/loaded_extensions.rbs +19 -0
  66. data/sig/dynamic_migrations/postgres/server/database/loaded_schemas.rbs +23 -0
  67. data/sig/dynamic_migrations/postgres/server/database/loaded_schemas_builder.rbs +27 -0
  68. data/sig/dynamic_migrations/postgres/server/database/schema/enum.rbs +28 -0
  69. data/sig/dynamic_migrations/postgres/server/database/schema/enums.rbs +31 -0
  70. data/sig/dynamic_migrations/postgres/server/database/schema/function.rbs +30 -0
  71. data/sig/dynamic_migrations/postgres/server/database/schema/functions.rbs +31 -0
  72. data/sig/dynamic_migrations/postgres/server/database/schema/table/column.rbs +28 -0
  73. data/sig/dynamic_migrations/postgres/server/database/schema/table/columns.rbs +30 -0
  74. data/sig/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraint.rbs +55 -0
  75. data/sig/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraints.rbs +32 -0
  76. data/sig/dynamic_migrations/postgres/server/database/schema/table/index.rbs +62 -0
  77. data/sig/dynamic_migrations/postgres/server/database/schema/table/indexes.rbs +31 -0
  78. data/sig/dynamic_migrations/postgres/server/database/schema/table/primary_key.rbs +40 -0
  79. data/sig/dynamic_migrations/postgres/server/database/schema/table/trigger.rbs +61 -0
  80. data/sig/dynamic_migrations/postgres/server/database/schema/table/triggers.rbs +33 -0
  81. data/sig/dynamic_migrations/postgres/server/database/schema/table/unique_constraint.rbs +49 -0
  82. data/sig/dynamic_migrations/postgres/server/database/schema/table/unique_constraints.rbs +31 -0
  83. data/sig/dynamic_migrations/postgres/server/database/schema/table/validation.rbs +43 -0
  84. data/sig/dynamic_migrations/postgres/server/database/schema/table/validations.rbs +31 -0
  85. data/sig/dynamic_migrations/postgres/server/database/schema/table.rbs +38 -0
  86. data/sig/dynamic_migrations/postgres/server/database/schema/tables.rbs +28 -0
  87. data/sig/dynamic_migrations/postgres/server/database/schema.rbs +21 -0
  88. data/sig/dynamic_migrations/postgres/server/database/source.rbs +18 -0
  89. data/sig/dynamic_migrations/postgres/server/database/structure_loader.rbs +19 -0
  90. data/sig/dynamic_migrations/postgres/server/database/triggers_and_functions_loader.rbs +20 -0
  91. data/sig/dynamic_migrations/postgres/server/database/validations_loader.rbs +15 -0
  92. data/sig/dynamic_migrations/postgres/server/database.rbs +34 -0
  93. data/sig/dynamic_migrations/postgres/server.rbs +19 -0
  94. data/sig/dynamic_migrations/postgres.rbs +4 -0
  95. data/sig/dynamic_migrations.rbs +6 -0
  96. data/sig/pg.rbs +20 -0
  97. data/sig/tsort.rbs +3 -0
  98. metadata +93 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6179ff02d722d3ed480dfe55af5283214bbc1c0a4e527e94b776d083d11ddbac
4
- data.tar.gz: 529ec5fa1d5e30a24a9b90afb9089ac94d16b5500b1bb89bcc9834e01fcf3402
3
+ metadata.gz: c2370c3373cb04ce64f20e48f15adf1f68cbacf17de79ca420f39f67c13536aa
4
+ data.tar.gz: 0d8d19007406180972f5a6304c01c0277079920bb8190705f2a246ef0975167a
5
5
  SHA512:
6
- metadata.gz: f0072b85a3a7fcad3ce51a5bddc64daf507830152e4f17448a0f7f33f6ebecd659590d4c82d7104d2743e4848765906dd8b7ac98509d1f3d6db8d012a40cda3c
7
- data.tar.gz: 25e037f431f8178f1b4906670a2e8fe9d93736034c0b3fd5184f1ab0643afdb9c1467e6febe29bed7c217de846bd7cd287a74198ee3f0afe251b805e3836f5a1
6
+ metadata.gz: de27b281b3e4494cfa5b3cc3835da3e71816c4a3b3e75bc92d96e2b69ae7e6169d9b32ebadc53c0f5e25d44378e81f46b26cc9db8cfb9c7bf97d009e4fc3eb3d
7
+ data.tar.gz: 79e609f4d4ce4272a8f82e4d11771faa05c9c380228e2587a96abb751fd9647d55f65f91e730ec0487ddc349cc6922f2e079782bcd355c17335a8f8d4c68caa7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.5.0](https://github.com/craigulliott/dynamic_migrations/compare/v3.4.1...v3.5.0) (2023-09-11)
4
+
5
+
6
+ ### Features
7
+
8
+ * adding rbs signatures to built gem so they are available in other projects ([03221b0](https://github.com/craigulliott/dynamic_migrations/commit/03221b0aa56acb9f1287f1d83c80570128793c7c))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixing broken test around db extension migrations ([cdd6fab](https://github.com/craigulliott/dynamic_migrations/commit/cdd6fabaeecc6d5c51f744222eb5b81f5c2ff759))
14
+ * wrapping extension name in quotes, removing rogue semicolon from generated method name ([a6bdbd4](https://github.com/craigulliott/dynamic_migrations/commit/a6bdbd4710efdd07821425259be2a7cd609bc637))
15
+
3
16
  ## [3.4.1](https://github.com/craigulliott/dynamic_migrations/compare/v3.4.0...v3.4.1) (2023-08-24)
4
17
 
5
18
 
@@ -73,32 +73,32 @@ module DynamicMigrations
73
73
 
74
74
  def referential_action_to_sql referential_action
75
75
  case referential_action
76
- # Produce an error indicating that the deletion or update would create a
77
- # foreign key constraint violation. If the constraint is deferred, this
78
- # error will be produced at constraint check time if there still exist
79
- # any referencing rows. This is the default action.
76
+ # Produce an error indicating that the deletion or update would create a
77
+ # foreign key constraint violation. If the constraint is deferred, this
78
+ # error will be produced at constraint check time if there still exist
79
+ # any referencing rows. This is the default action.
80
80
  when :no_action
81
81
  "NO ACTION"
82
82
 
83
- # Produce an error indicating that the deletion or update would create a
84
- # foreign key constraint violation. This is the same as NO ACTION except
85
- # that the check is not deferrable.
83
+ # Produce an error indicating that the deletion or update would create a
84
+ # foreign key constraint violation. This is the same as NO ACTION except
85
+ # that the check is not deferrable.
86
86
  when :restrict
87
87
  "RESTRICT"
88
88
 
89
- # Delete any rows referencing the deleted row, or update the values of
90
- # the referencing column(s) to the new values of the referenced columns,
91
- # respectively.
89
+ # Delete any rows referencing the deleted row, or update the values of
90
+ # the referencing column(s) to the new values of the referenced columns,
91
+ # respectively.
92
92
  when :cascade
93
93
  "CASCADE"
94
94
 
95
- # Set all of the referencing columns, or a specified subset of the
96
- # referencing columns, to null.
95
+ # Set all of the referencing columns, or a specified subset of the
96
+ # referencing columns, to null.
97
97
  when :set_null
98
98
  "SET NULL"
99
99
 
100
- # Set all of the referencing columns, or a specified subset of the
101
- # referencing columns, to their default values.
100
+ # Set all of the referencing columns, or a specified subset of the
101
+ # referencing columns, to their default values.
102
102
  when :set_default
103
103
  "SET DEFAULT"
104
104
 
@@ -8,7 +8,7 @@ module DynamicMigrations
8
8
  object: extension_name,
9
9
  code_comment: code_comment,
10
10
  migration: <<~RUBY
11
- create_extension :#{extension_name}
11
+ create_extension "#{extension_name}"
12
12
  RUBY
13
13
  end
14
14
 
@@ -18,7 +18,7 @@ module DynamicMigrations
18
18
  object: extension_name,
19
19
  code_comment: code_comment,
20
20
  migration: <<~RUBY
21
- drop_extension :#{extension_name}
21
+ drop_extension "#{extension_name}"
22
22
  RUBY
23
23
  end
24
24
  end
@@ -165,10 +165,10 @@ module DynamicMigrations
165
165
  :enums
166
166
 
167
167
  elsif all_fragments_for_method? [:create_extension]
168
- (@fragments.count > 1) ? :":create_extensions" : :"create_#{fragments.first&.object_name}_extension"
168
+ (@fragments.count > 1) ? :create_extensions : :"create_#{fragments.first&.object_name}_extension"
169
169
 
170
170
  elsif all_fragments_for_method? [:drop_extension]
171
- (@fragments.count > 1) ? :":drop_extensions" : :"drop_#{fragments.first&.object_name}_extension"
171
+ (@fragments.count > 1) ? :drop_extensions : :"drop_#{fragments.first&.object_name}_extension"
172
172
 
173
173
  elsif @fragments.first&.table_name
174
174
  :"changes_for_#{@fragments.first&.table_name}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicMigrations
4
- VERSION = "3.4.1"
4
+ VERSION = "3.5.0"
5
5
  end
@@ -0,0 +1,18 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Column
8
+ def set_column_comment: (Symbol table_name, Symbol column_name, String comment) -> void
9
+ def remove_column_comment: (Symbol table_name, Symbol column_name) -> void
10
+
11
+ # stubbing these out, as they are available on the module which includes this module
12
+ def execute: (String sql) -> void
13
+ def schema_name: () -> Symbol
14
+ def quote: (String str) -> String
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Enum
8
+ def create_enum: (Symbol enum_name, Array[Symbol] values) -> void
9
+ def add_enum_values: (Symbol enum_name, Array[Symbol] values) -> void
10
+ def drop_enum: (Symbol enum_name) -> void
11
+ def set_enum_comment: (Symbol enum_name, String comment) -> void
12
+ def remove_enum_comment: (Symbol enum_name) -> void
13
+
14
+ # stubbing these out, as they are available on the module which includes this module
15
+ def execute: (String sql) -> Array[untyped]
16
+ def schema_name: () -> Symbol
17
+ def quote: (String str) -> String
18
+
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module ForeignKeyConstraint
8
+ def add_foreign_key: (Symbol table_name, Array[Symbol] column_names, Symbol foreign_schema_name, Symbol foreign_table_name, Array[Symbol] foreign_column_names, name: Symbol, ?initially_deferred: bool, ?deferrable: bool, ?on_delete: Symbol, ?on_update: Symbol, ?comment: String?) -> void
9
+ def remove_foreign_key: (Symbol table_name, Symbol name) -> void
10
+ def set_foreign_key_comment: (Symbol table_name, Symbol foreign_key_name, String comment) -> void
11
+ def remove_foreign_key_comment: (Symbol table_name, Symbol foreign_key_name) -> void
12
+
13
+ # stubbing these out, as they are available on the module which includes this module
14
+ def execute: (String sql) -> void
15
+ def schema_name: () -> Symbol
16
+ def quote: (String str) -> String
17
+
18
+ private
19
+ def referential_action_to_sql: (Symbol referential_action_to_sql) -> String
20
+
21
+ class ForeignKeyOnDeleteOptionsError < StandardError
22
+ end
23
+
24
+ class UnexpectedReferentialActionError < StandardError
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,28 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Function
8
+ def create_function: (Symbol table_name, Symbol function_name, ?comment: String?) -> void
9
+ def update_function: (Symbol table_name, Symbol function_name, ?comment: String?) -> void
10
+ def drop_function: (Symbol function_name) -> void
11
+ def set_function_comment: (Symbol function_name, String comment) -> void
12
+ def remove_function_comment: (Symbol function_name) -> void
13
+
14
+ # stubbing these out, as they are available on the module which includes this module
15
+ def execute: (String sql) -> Array[untyped]
16
+ def schema_name: () -> Symbol
17
+ def quote: (String str) -> String
18
+
19
+ class FunctionDoesNotExistError < StandardError
20
+ end
21
+
22
+ # this error is actually available on the module which includes this module
23
+ class MissingFunctionBlockError < StandardError
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,17 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Index
8
+ def set_index_comment: (Symbol table_name, Symbol index_name, String comment) -> void
9
+ def remove_index_comment: (Symbol table_name, Symbol index_name) -> void
10
+
11
+ # stubbing these out, as they are available on the module which includes this module
12
+ def execute: (String sql) -> void
13
+ def quote: (String str) -> String
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Schema
8
+ def create_schema: () -> void
9
+ def drop_schema: () -> void
10
+
11
+ # stubbing these out, as they are available on the module which includes this module
12
+ def execute: (String sql) -> void
13
+ def schema_name: () -> Symbol
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Table
8
+ def set_table_comment: (Symbol table_name, String comment) -> void
9
+ def remove_table_comment: (Symbol table_name) -> void
10
+
11
+ # stubbing these out, as they are available on the module which includes this module
12
+ def execute: (String sql) -> void
13
+ def schema_name: () -> Symbol
14
+ def quote: (String str) -> String
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Trigger
8
+ def add_trigger: (Symbol table_name, name: Symbol, action_timing: Symbol, event_manipulation: Symbol, action_orientation: Symbol, function_schema_name: Symbol, function_name: Symbol, ?parameters: String?, ?action_condition: String?, ?action_reference_old_table: Symbol?, ?action_reference_new_table: Symbol?, ?comment: String?) -> void
9
+ def remove_trigger: (Symbol table_name, Symbol trigger_name) -> void
10
+ def set_trigger_comment: (Symbol table_name, Symbol trigger_name, String comment) -> void
11
+ def remove_trigger_comment: (Symbol table_name, Symbol trigger_name) -> void
12
+
13
+ # stubbing these out, as they are available on the module which includes this module
14
+ def execute: (String sql) -> void
15
+ def schema_name: () -> Symbol
16
+ def quote: (String str) -> String
17
+
18
+ class UnexpectedEventManipulationError < StandardError
19
+ end
20
+
21
+ class UnexpectedActionOrientationError < StandardError
22
+ end
23
+
24
+ class UnexpectedActionTimingError < StandardError
25
+ end
26
+
27
+ class UnexpectedConditionsError < StandardError
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module UniqueConstraint
8
+ def add_unique_constraint: (Symbol table_name, Array[Symbol] column_names, name: Symbol, ?deferrable: bool, ?initially_deferred: bool, ?comment: String?) -> void
9
+ def remove_unique_constraint: (Symbol table_name, Symbol name) -> void
10
+ def set_unique_constraint_comment: (Symbol table_name, Symbol unique_constraint_name, String comment) -> void
11
+ def remove_unique_constraint_comment: (Symbol table_name, Symbol unique_constraint_name) -> void
12
+
13
+ # stubbing these out, as they are available on the module which includes this module
14
+ def execute: (String sql) -> void
15
+ def schema_name: () -> Symbol
16
+ def quote: (String str) -> String
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ module Validation
8
+ def add_validation: (Symbol table_name, name: Symbol, ?initially_deferred: bool, ?deferrable: bool, ?comment: String?) -> void
9
+ def remove_validation: (Symbol table_name, Symbol name) -> void
10
+ def set_validation_comment: (Symbol table_name, Symbol validation_name, String comment) -> void
11
+ def remove_validation_comment: (Symbol table_name, Symbol validation_name) -> void
12
+
13
+ # stubbing these out, as they are available on the module which includes this module
14
+ def execute: (String sql) -> void
15
+ def schema_name: () -> Symbol
16
+ def quote: (String str) -> String
17
+
18
+ # this error is actually available on the module which includes this module
19
+ class MissingFunctionBlockError < StandardError
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,37 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module ActiveRecord
6
+ module Migrators
7
+ self.@current_schema: nil
8
+
9
+ include Schema
10
+ include Validation
11
+ include ForeignKeyConstraint
12
+ include Column
13
+ include Table
14
+ include Index
15
+ include Function
16
+ include Trigger
17
+
18
+ def self.schema_name: -> nil
19
+ def self.set_schema_name: (untyped schema_name) -> untyped
20
+ def self.clear_schema_name: -> nil
21
+ def self.included: (untyped klass) -> untyped
22
+ def schema_name: -> nil
23
+
24
+ # this methods comes from active record once the module has been included
25
+ def connection: -> untyped
26
+
27
+ class SchemaNameNotSetError < StandardError
28
+ end
29
+
30
+ class DeferrableOptionsError < StandardError
31
+ end
32
+
33
+ class MissingFunctionBlockError < StandardError
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,4 @@
1
+ module DynamicMigrations
2
+ class ExpectedBooleanError < StandardError
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module DynamicMigrations
2
+ class ExpectedIntegerError < StandardError
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module DynamicMigrations
2
+ class ExpectedStringError < StandardError
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module DynamicMigrations
2
+ class ExpectedSymbolError < StandardError
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module DynamicMigrations
2
+ class InvalidSourceError < StandardError
3
+ def initialize: (untyped source) -> void
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ class ModuleIncludedIntoUnexpectedTargetError < StandardError
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module DynamicMigrations
2
+ module NameHelper
3
+ def abbreviate_table_name: (String table_name) -> String
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ module DynamicMigrations
2
+ module Postgres
3
+ module Connections
4
+ self.@connections: Hash[PG::Connection, true]
5
+
6
+ def self.create_connection: (String host, Integer port, String username, String password, Symbol database) -> PG::Connection
7
+ def self.connections: -> Array[PG::Connection]
8
+ def self.disconnect: (PG::Connection connection) -> bool
9
+ def self.disconnect_all: -> void
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,24 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ module Column
8
+ def add_column: (Postgres::Server::Database::Schema::Table::Column column, ?String? code_comment) -> Fragment
9
+ def change_column: (Postgres::Server::Database::Schema::Table::Column column, ?String? code_comment) -> Fragment
10
+ def remove_column: (Postgres::Server::Database::Schema::Table::Column column, ?String? code_comment) -> Fragment
11
+ def set_column_comment: (Postgres::Server::Database::Schema::Table::Column column, ?String? code_comment) -> Fragment
12
+ def remove_column_comment: (Postgres::Server::Database::Schema::Table::Column column, ?String? code_comment) -> Fragment
13
+
14
+ # these come from the generator object (which this module is included into)
15
+ def add_fragment: (migration_method: Symbol, object: untyped, migration: String, ?schema: Server::Database::Schema?, ?table: Server::Database::Schema::Table?, ?code_comment: String?, ?dependent_table: Server::Database::Schema::Table?) -> untyped
16
+
17
+ def indent: (String migration, ?Integer levels) -> String
18
+
19
+ class NoColumnCommentError < StandardError
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,12 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ class DatabaseMigration < Migration
8
+ def initialize: () -> void
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ module Enum
8
+ def create_enum: (Server::Database::Schema::Enum enum, ?String? code_comment) -> Fragment
9
+ def update_enum: (Server::Database::Schema::Enum original_enum, Server::Database::Schema::Enum updated_enum, ?String? code_comment) -> Fragment
10
+ def drop_enum: (Server::Database::Schema::Enum enum, ?String? code_comment) -> Fragment
11
+ def set_enum_comment: (Server::Database::Schema::Enum enum, ?String? code_comment) -> Fragment
12
+ def remove_enum_comment: (Server::Database::Schema::Enum enum, ?String? code_comment) -> Fragment
13
+ # these come from the generator object (which this module is included into)
14
+ def add_fragment: (schema: Server::Database::Schema, migration_method: Symbol, object: Server::Database::Schema::Enum enum, migration: String, ?table: nil | Server::Database::Schema::Table, ?code_comment: String?, ?dependent_table: nil | Server::Database::Schema::Table) -> Fragment
15
+ def indent: (String migration, ?Integer levels) -> String
16
+
17
+ class UnremovableEnumValuesError < StandardError
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,16 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ module Extension
8
+ def create_extension: (Symbol extension_name, ?String? code_comment) -> Fragment
9
+ def drop_extension: (Symbol extension_name, ?String? code_comment) -> Fragment
10
+
11
+ # these come from the generator object (which this module is included into)
12
+ def add_fragment: (migration_method: Symbol, object: untyped, migration: String, ?schema: Server::Database::Schema?, ?table: Server::Database::Schema::Table?, ?code_comment: String?, ?dependent_table: Server::Database::Schema::Table?) -> untyped
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ module ForeignKeyConstraint
8
+ def add_foreign_key_constraint: (Postgres::Server::Database::Schema::Table::ForeignKeyConstraint foreign_key_constraint, ?String? code_comment) -> Fragment
9
+ def remove_foreign_key_constraint: (Postgres::Server::Database::Schema::Table::ForeignKeyConstraint foreign_key_constraint, ?String? code_comment) -> Fragment
10
+ def recreate_foreign_key_constraint: (Postgres::Server::Database::Schema::Table::ForeignKeyConstraint original_foreign_key_constraint, Postgres::Server::Database::Schema::Table::ForeignKeyConstraint updated_foreign_key_constraint) -> Array[Fragment]
11
+ def set_foreign_key_constraint_comment: (Postgres::Server::Database::Schema::Table::ForeignKeyConstraint foreign_key_constraint, ?String? code_comment) -> Fragment
12
+ def remove_foreign_key_constraint_comment: (Postgres::Server::Database::Schema::Table::ForeignKeyConstraint foreign_key_constraint, ?String? code_comment) -> Fragment
13
+
14
+ # these come from the generator object (which this module is included into)
15
+ def add_fragment: (migration_method: Symbol, object: untyped, migration: String, ?schema: Server::Database::Schema?, ?table: Server::Database::Schema::Table?, ?code_comment: String?, ?dependent_table: Server::Database::Schema::Table?) -> untyped
16
+
17
+ def indent: (String migration, ?Integer levels) -> String
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,32 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ class Fragment
8
+ @content: String
9
+ @code_comment: String?
10
+
11
+ attr_reader migration_method: Symbol
12
+ attr_reader object_name: Symbol
13
+ # schema_name can be nill for database only migrations, like `create extension`
14
+ attr_reader schema_name: Symbol?
15
+ # table_name can be nil because some migrations, such
16
+ # as ones which pertain to functions and creating/dropping
17
+ # schemas don't require tables
18
+ attr_reader table_name: Symbol?
19
+ # dependecy on a table is optional
20
+ attr_reader dependency_schema_name: Symbol?
21
+ attr_reader dependency_table_name: Symbol?
22
+
23
+ def initialize: (Symbol? schema_name, Symbol? table_name, Symbol migration_method, Symbol object_name, String? code_comment, String content) -> void
24
+ def to_s: -> String
25
+ def has_code_comment?: -> bool
26
+ def dependency: -> ({schema_name: Symbol, table_name: Symbol} | nil)
27
+ def is_dependent_on?: (Symbol schema_name, Symbol table_name) -> bool
28
+ def set_dependent_table: (Symbol schema_name, Symbol table_name) -> void
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ module Function
8
+ def create_function: (Postgres::Server::Database::Schema::Function function, ?String? code_comment) -> Fragment
9
+ def update_function: (Postgres::Server::Database::Schema::Function function, ?String? code_comment) -> Fragment
10
+ def drop_function: (Postgres::Server::Database::Schema::Function function, ?String? code_comment) -> Fragment
11
+ def set_function_comment: (Postgres::Server::Database::Schema::Function function, ?String? code_comment) -> Fragment
12
+ def remove_function_comment: (Postgres::Server::Database::Schema::Function function, ?String? code_comment) -> Fragment
13
+
14
+ # these come from the generator object (which this module is included into)
15
+ def add_fragment: (migration_method: Symbol, object: untyped, migration: String, ?schema: Server::Database::Schema?, ?table: Server::Database::Schema::Table?, ?code_comment: String?, ?dependent_table: Server::Database::Schema::Table?) -> untyped
16
+
17
+ def indent: (String migration, ?Integer levels) -> String
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # TypeProf 0.21.7
2
+
3
+ # Classes
4
+ module DynamicMigrations
5
+ module Postgres
6
+ class Generator
7
+ module Index
8
+ def add_index: (Postgres::Server::Database::Schema::Table::Index index, ?String? code_comment) -> Fragment
9
+ def remove_index: (Postgres::Server::Database::Schema::Table::Index index, ?String? code_comment) -> Fragment
10
+ def recreate_index: (Postgres::Server::Database::Schema::Table::Index original_index, Postgres::Server::Database::Schema::Table::Index updated_index) -> Array[Fragment]
11
+ def set_index_comment: (Postgres::Server::Database::Schema::Table::Index index, ?String? code_comment) -> Fragment
12
+ def remove_index_comment: (Postgres::Server::Database::Schema::Table::Index index, ?String? code_comment) -> Fragment
13
+
14
+ # these come from the generator object (which this module is included into)
15
+ def add_fragment: (migration_method: Symbol, object: untyped, migration: String, ?schema: Server::Database::Schema?, ?table: Server::Database::Schema::Table?, ?code_comment: String?, ?dependent_table: Server::Database::Schema::Table?) -> untyped
16
+
17
+ def indent: (String migration, ?Integer levels) -> String
18
+ end
19
+ end
20
+ end
21
+ end