dynamic_migrations 3.4.1 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/lib/dynamic_migrations/active_record/migrators/foreign_key_constraint.rb +14 -14
  4. data/lib/dynamic_migrations/postgres/generator/column.rb +1 -1
  5. data/lib/dynamic_migrations/postgres/generator/extension.rb +2 -2
  6. data/lib/dynamic_migrations/postgres/generator/foreign_key_constraint.rb +1 -1
  7. data/lib/dynamic_migrations/postgres/generator/index.rb +1 -1
  8. data/lib/dynamic_migrations/postgres/generator/migration.rb +2 -2
  9. data/lib/dynamic_migrations/postgres/generator/table.rb +1 -1
  10. data/lib/dynamic_migrations/postgres/generator/trigger.rb +1 -1
  11. data/lib/dynamic_migrations/postgres/generator/unique_constraint.rb +1 -1
  12. data/lib/dynamic_migrations/postgres/generator/validation.rb +1 -1
  13. data/lib/dynamic_migrations/postgres/server/database/differences.rb +1 -1
  14. data/lib/dynamic_migrations/version.rb +1 -1
  15. data/sig/dynamic_migrations/active_record/migrators/column.rbs +18 -0
  16. data/sig/dynamic_migrations/active_record/migrators/enum.rbs +22 -0
  17. data/sig/dynamic_migrations/active_record/migrators/foreign_key_constraint.rbs +29 -0
  18. data/sig/dynamic_migrations/active_record/migrators/function.rbs +28 -0
  19. data/sig/dynamic_migrations/active_record/migrators/index.rbs +17 -0
  20. data/sig/dynamic_migrations/active_record/migrators/schema.rbs +17 -0
  21. data/sig/dynamic_migrations/active_record/migrators/table.rbs +18 -0
  22. data/sig/dynamic_migrations/active_record/migrators/trigger.rbs +32 -0
  23. data/sig/dynamic_migrations/active_record/migrators/unique_constraint.rbs +20 -0
  24. data/sig/dynamic_migrations/active_record/migrators/validation.rbs +24 -0
  25. data/sig/dynamic_migrations/active_record/migrators.rbs +37 -0
  26. data/sig/dynamic_migrations/expected_boolean_error.rbs +4 -0
  27. data/sig/dynamic_migrations/expected_integer_error.rbs +4 -0
  28. data/sig/dynamic_migrations/expected_string_error.rbs +4 -0
  29. data/sig/dynamic_migrations/expected_symbol_error.rbs +4 -0
  30. data/sig/dynamic_migrations/invalid_source_error.rbs +5 -0
  31. data/sig/dynamic_migrations/module_included_into_unexpected_target_error.rbs +7 -0
  32. data/sig/dynamic_migrations/name_helper.rbs +5 -0
  33. data/sig/dynamic_migrations/postgres/connections.rbs +12 -0
  34. data/sig/dynamic_migrations/postgres/generator/column.rbs +24 -0
  35. data/sig/dynamic_migrations/postgres/generator/database_migration.rbs +12 -0
  36. data/sig/dynamic_migrations/postgres/generator/enum.rbs +23 -0
  37. data/sig/dynamic_migrations/postgres/generator/extension.rbs +16 -0
  38. data/sig/dynamic_migrations/postgres/generator/foreign_key_constraint.rbs +21 -0
  39. data/sig/dynamic_migrations/postgres/generator/fragment.rbs +32 -0
  40. data/sig/dynamic_migrations/postgres/generator/function.rbs +21 -0
  41. data/sig/dynamic_migrations/postgres/generator/index.rbs +21 -0
  42. data/sig/dynamic_migrations/postgres/generator/migration.rbs +58 -0
  43. data/sig/dynamic_migrations/postgres/generator/migration_dependency_sorter.rbs +12 -0
  44. data/sig/dynamic_migrations/postgres/generator/primary_key.rbs +20 -0
  45. data/sig/dynamic_migrations/postgres/generator/schema.rbs +17 -0
  46. data/sig/dynamic_migrations/postgres/generator/schema_migration.rbs +13 -0
  47. data/sig/dynamic_migrations/postgres/generator/table.rbs +30 -0
  48. data/sig/dynamic_migrations/postgres/generator/table_migration.rbs +12 -0
  49. data/sig/dynamic_migrations/postgres/generator/trigger.rbs +22 -0
  50. data/sig/dynamic_migrations/postgres/generator/unique_constraint.rbs +21 -0
  51. data/sig/dynamic_migrations/postgres/generator/validation.rbs +21 -0
  52. data/sig/dynamic_migrations/postgres/generator.rbs +57 -0
  53. data/sig/dynamic_migrations/postgres/server/database/configured_extensions.rbs +18 -0
  54. data/sig/dynamic_migrations/postgres/server/database/configured_schemas.rbs +23 -0
  55. data/sig/dynamic_migrations/postgres/server/database/connection.rbs +29 -0
  56. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/extensions.rbs +22 -0
  57. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/enums.rbs +24 -0
  58. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/functions.rbs +24 -0
  59. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/columns.rbs +26 -0
  60. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/foreign_key_constraints.rbs +26 -0
  61. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/indexes.rbs +26 -0
  62. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/primary_key.rbs +25 -0
  63. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/triggers.rbs +26 -0
  64. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/unique_constraints.rbs +26 -0
  65. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/validations.rbs +26 -0
  66. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables.rbs +33 -0
  67. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas.rbs +30 -0
  68. data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations.rbs +47 -0
  69. data/sig/dynamic_migrations/postgres/server/database/differences.rbs +54 -0
  70. data/sig/dynamic_migrations/postgres/server/database/enums_loader.rbs +18 -0
  71. data/sig/dynamic_migrations/postgres/server/database/extensions_loader.rbs +17 -0
  72. data/sig/dynamic_migrations/postgres/server/database/keys_and_unique_constraints_loader.rbs +15 -0
  73. data/sig/dynamic_migrations/postgres/server/database/loaded_extensions.rbs +19 -0
  74. data/sig/dynamic_migrations/postgres/server/database/loaded_schemas.rbs +23 -0
  75. data/sig/dynamic_migrations/postgres/server/database/loaded_schemas_builder.rbs +27 -0
  76. data/sig/dynamic_migrations/postgres/server/database/schema/enum.rbs +28 -0
  77. data/sig/dynamic_migrations/postgres/server/database/schema/enums.rbs +31 -0
  78. data/sig/dynamic_migrations/postgres/server/database/schema/function.rbs +30 -0
  79. data/sig/dynamic_migrations/postgres/server/database/schema/functions.rbs +31 -0
  80. data/sig/dynamic_migrations/postgres/server/database/schema/table/column.rbs +28 -0
  81. data/sig/dynamic_migrations/postgres/server/database/schema/table/columns.rbs +30 -0
  82. data/sig/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraint.rbs +55 -0
  83. data/sig/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraints.rbs +32 -0
  84. data/sig/dynamic_migrations/postgres/server/database/schema/table/index.rbs +62 -0
  85. data/sig/dynamic_migrations/postgres/server/database/schema/table/indexes.rbs +31 -0
  86. data/sig/dynamic_migrations/postgres/server/database/schema/table/primary_key.rbs +40 -0
  87. data/sig/dynamic_migrations/postgres/server/database/schema/table/trigger.rbs +61 -0
  88. data/sig/dynamic_migrations/postgres/server/database/schema/table/triggers.rbs +33 -0
  89. data/sig/dynamic_migrations/postgres/server/database/schema/table/unique_constraint.rbs +49 -0
  90. data/sig/dynamic_migrations/postgres/server/database/schema/table/unique_constraints.rbs +31 -0
  91. data/sig/dynamic_migrations/postgres/server/database/schema/table/validation.rbs +43 -0
  92. data/sig/dynamic_migrations/postgres/server/database/schema/table/validations.rbs +31 -0
  93. data/sig/dynamic_migrations/postgres/server/database/schema/table.rbs +38 -0
  94. data/sig/dynamic_migrations/postgres/server/database/schema/tables.rbs +28 -0
  95. data/sig/dynamic_migrations/postgres/server/database/schema.rbs +21 -0
  96. data/sig/dynamic_migrations/postgres/server/database/source.rbs +18 -0
  97. data/sig/dynamic_migrations/postgres/server/database/structure_loader.rbs +19 -0
  98. data/sig/dynamic_migrations/postgres/server/database/triggers_and_functions_loader.rbs +20 -0
  99. data/sig/dynamic_migrations/postgres/server/database/validations_loader.rbs +15 -0
  100. data/sig/dynamic_migrations/postgres/server/database.rbs +34 -0
  101. data/sig/dynamic_migrations/postgres/server.rbs +19 -0
  102. data/sig/dynamic_migrations/postgres.rbs +4 -0
  103. data/sig/dynamic_migrations.rbs +6 -0
  104. data/sig/pg.rbs +20 -0
  105. data/sig/tsort.rbs +3 -0
  106. 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: 10d870837ddf3e4c71fa66f94012de4633865cb026e18ad436427439d670a1e5
4
+ data.tar.gz: fc9a1eb789cce002adb18b08132de5618aa04b6effcb50ac4c2bd032594eaee1
5
5
  SHA512:
6
- metadata.gz: f0072b85a3a7fcad3ce51a5bddc64daf507830152e4f17448a0f7f33f6ebecd659590d4c82d7104d2743e4848765906dd8b7ac98509d1f3d6db8d012a40cda3c
7
- data.tar.gz: 25e037f431f8178f1b4906670a2e8fe9d93736034c0b3fd5184f1ab0643afdb9c1467e6febe29bed7c217de846bd7cd287a74198ee3f0afe251b805e3836f5a1
6
+ metadata.gz: 6e0b1524b32ae7e2095a158914a230386e0b31cfdfb93c57aaf98775972501d3b11460cc96094abaee3a673abebdd2cdb5416ad7c921b4b33d2d0173fbf91dd1
7
+ data.tar.gz: '0669156389241de166d9ae906180a87fa6f286677463bcbfec4323e1cc7f2e01675a10b1057a48341efce2f338011b6ae2fce83e66de4ff2eacf6bb61f120fd7'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.5.1](https://github.com/craigulliott/dynamic_migrations/compare/v3.5.0...v3.5.1) (2023-09-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * missing primary key should be represented by nil when building differences, and added some more descriptive error messages ([491c1c2](https://github.com/craigulliott/dynamic_migrations/commit/491c1c2d7c2128f3f4ad3f2a21b0b52c67029185))
9
+
10
+ ## [3.5.0](https://github.com/craigulliott/dynamic_migrations/compare/v3.4.1...v3.5.0) (2023-09-11)
11
+
12
+
13
+ ### Features
14
+
15
+ * adding rbs signatures to built gem so they are available in other projects ([03221b0](https://github.com/craigulliott/dynamic_migrations/commit/03221b0aa56acb9f1287f1d83c80570128793c7c))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * fixing broken test around db extension migrations ([cdd6fab](https://github.com/craigulliott/dynamic_migrations/commit/cdd6fabaeecc6d5c51f744222eb5b81f5c2ff759))
21
+ * wrapping extension name in quotes, removing rogue semicolon from generated method name ([a6bdbd4](https://github.com/craigulliott/dynamic_migrations/commit/a6bdbd4710efdd07821425259be2a7cd609bc637))
22
+
3
23
  ## [3.4.1](https://github.com/craigulliott/dynamic_migrations/compare/v3.4.0...v3.4.1) (2023-08-24)
4
24
 
5
25
 
@@ -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
 
@@ -92,7 +92,7 @@ module DynamicMigrations
92
92
  description = column.description
93
93
 
94
94
  if description.nil?
95
- raise MissingDescriptionError
95
+ raise MissingDescriptionError, "Missing required description for column `#{column.name}` in table `#{column.table.schema.name}.#{column.table.name}`"
96
96
  end
97
97
 
98
98
  add_fragment schema: column.table.schema,
@@ -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
@@ -73,7 +73,7 @@ module DynamicMigrations
73
73
  description = foreign_key_constraint.description
74
74
 
75
75
  if description.nil?
76
- raise MissingDescriptionError
76
+ raise MissingDescriptionError, "Missing required description for foreign_key_constraint `#{foreign_key_constraint.name}` in table `#{foreign_key_constraint.table.schema.name}.#{foreign_key_constraint.table.name}`"
77
77
  end
78
78
 
79
79
  add_fragment schema: foreign_key_constraint.table.schema,
@@ -89,7 +89,7 @@ module DynamicMigrations
89
89
  description = index.description
90
90
 
91
91
  if description.nil?
92
- raise MissingDescriptionError
92
+ raise MissingDescriptionError, "Missing required description for index `#{index.name}` in table `#{index.table.schema.name}.#{index.table.name}`"
93
93
  end
94
94
 
95
95
  add_fragment schema: index.table.schema,
@@ -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}"
@@ -44,7 +44,7 @@ module DynamicMigrations
44
44
  description = table.description
45
45
 
46
46
  if description.nil?
47
- raise MissingDescriptionError
47
+ raise MissingDescriptionError, "Missing required description for table `#{table.schema.name}.#{table.name}`"
48
48
  end
49
49
 
50
50
  add_fragment schema: table.schema,
@@ -93,7 +93,7 @@ module DynamicMigrations
93
93
  description = trigger.description
94
94
 
95
95
  if description.nil?
96
- raise MissingDescriptionError
96
+ raise MissingDescriptionError, "Missing required description for trigger `#{trigger.name}` on table `#{trigger.table.schema.name}.#{trigger.table.name}`"
97
97
  end
98
98
 
99
99
  add_fragment schema: trigger.table.schema,
@@ -67,7 +67,7 @@ module DynamicMigrations
67
67
  description = unique_constraint.description
68
68
 
69
69
  if description.nil?
70
- raise MissingDescriptionError
70
+ raise MissingDescriptionError, "Missing required description for unique_constraint `#{unique_constraint.name}` in table `#{unique_constraint.table.schema.name}.#{unique_constraint.table.name}`"
71
71
  end
72
72
 
73
73
  add_fragment schema: unique_constraint.table.schema,
@@ -75,7 +75,7 @@ module DynamicMigrations
75
75
  description = validation.description
76
76
 
77
77
  if description.nil?
78
- raise MissingDescriptionError
78
+ raise MissingDescriptionError, "Missing required description for validation `#{validation.name}` in table `#{validation.table.schema.name}.#{validation.table.name}`"
79
79
  end
80
80
 
81
81
  add_fragment schema: validation.table.schema,
@@ -136,7 +136,7 @@ module DynamicMigrations
136
136
  comparison_foreign_key_constraints = comparison_table.foreign_key_constraints_hash
137
137
  comparison_unique_constraints = comparison_table.unique_constraints_hash
138
138
  else
139
- comparison_primary_key = {}
139
+ comparison_primary_key = nil
140
140
  comparison_columns = {}
141
141
  comparison_indexes = {}
142
142
  comparison_triggers = {}
@@ -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.1"
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