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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/lib/dynamic_migrations/active_record/migrators/foreign_key_constraint.rb +14 -14
- data/lib/dynamic_migrations/postgres/generator/column.rb +1 -1
- data/lib/dynamic_migrations/postgres/generator/extension.rb +2 -2
- data/lib/dynamic_migrations/postgres/generator/foreign_key_constraint.rb +1 -1
- data/lib/dynamic_migrations/postgres/generator/index.rb +1 -1
- data/lib/dynamic_migrations/postgres/generator/migration.rb +2 -2
- data/lib/dynamic_migrations/postgres/generator/table.rb +1 -1
- data/lib/dynamic_migrations/postgres/generator/trigger.rb +1 -1
- data/lib/dynamic_migrations/postgres/generator/unique_constraint.rb +1 -1
- data/lib/dynamic_migrations/postgres/generator/validation.rb +1 -1
- data/lib/dynamic_migrations/postgres/server/database/differences.rb +1 -1
- data/lib/dynamic_migrations/version.rb +1 -1
- data/sig/dynamic_migrations/active_record/migrators/column.rbs +18 -0
- data/sig/dynamic_migrations/active_record/migrators/enum.rbs +22 -0
- data/sig/dynamic_migrations/active_record/migrators/foreign_key_constraint.rbs +29 -0
- data/sig/dynamic_migrations/active_record/migrators/function.rbs +28 -0
- data/sig/dynamic_migrations/active_record/migrators/index.rbs +17 -0
- data/sig/dynamic_migrations/active_record/migrators/schema.rbs +17 -0
- data/sig/dynamic_migrations/active_record/migrators/table.rbs +18 -0
- data/sig/dynamic_migrations/active_record/migrators/trigger.rbs +32 -0
- data/sig/dynamic_migrations/active_record/migrators/unique_constraint.rbs +20 -0
- data/sig/dynamic_migrations/active_record/migrators/validation.rbs +24 -0
- data/sig/dynamic_migrations/active_record/migrators.rbs +37 -0
- data/sig/dynamic_migrations/expected_boolean_error.rbs +4 -0
- data/sig/dynamic_migrations/expected_integer_error.rbs +4 -0
- data/sig/dynamic_migrations/expected_string_error.rbs +4 -0
- data/sig/dynamic_migrations/expected_symbol_error.rbs +4 -0
- data/sig/dynamic_migrations/invalid_source_error.rbs +5 -0
- data/sig/dynamic_migrations/module_included_into_unexpected_target_error.rbs +7 -0
- data/sig/dynamic_migrations/name_helper.rbs +5 -0
- data/sig/dynamic_migrations/postgres/connections.rbs +12 -0
- data/sig/dynamic_migrations/postgres/generator/column.rbs +24 -0
- data/sig/dynamic_migrations/postgres/generator/database_migration.rbs +12 -0
- data/sig/dynamic_migrations/postgres/generator/enum.rbs +23 -0
- data/sig/dynamic_migrations/postgres/generator/extension.rbs +16 -0
- data/sig/dynamic_migrations/postgres/generator/foreign_key_constraint.rbs +21 -0
- data/sig/dynamic_migrations/postgres/generator/fragment.rbs +32 -0
- data/sig/dynamic_migrations/postgres/generator/function.rbs +21 -0
- data/sig/dynamic_migrations/postgres/generator/index.rbs +21 -0
- data/sig/dynamic_migrations/postgres/generator/migration.rbs +58 -0
- data/sig/dynamic_migrations/postgres/generator/migration_dependency_sorter.rbs +12 -0
- data/sig/dynamic_migrations/postgres/generator/primary_key.rbs +20 -0
- data/sig/dynamic_migrations/postgres/generator/schema.rbs +17 -0
- data/sig/dynamic_migrations/postgres/generator/schema_migration.rbs +13 -0
- data/sig/dynamic_migrations/postgres/generator/table.rbs +30 -0
- data/sig/dynamic_migrations/postgres/generator/table_migration.rbs +12 -0
- data/sig/dynamic_migrations/postgres/generator/trigger.rbs +22 -0
- data/sig/dynamic_migrations/postgres/generator/unique_constraint.rbs +21 -0
- data/sig/dynamic_migrations/postgres/generator/validation.rbs +21 -0
- data/sig/dynamic_migrations/postgres/generator.rbs +57 -0
- data/sig/dynamic_migrations/postgres/server/database/configured_extensions.rbs +18 -0
- data/sig/dynamic_migrations/postgres/server/database/configured_schemas.rbs +23 -0
- data/sig/dynamic_migrations/postgres/server/database/connection.rbs +29 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/extensions.rbs +22 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/enums.rbs +24 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/functions.rbs +24 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/columns.rbs +26 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/foreign_key_constraints.rbs +26 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/indexes.rbs +26 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/primary_key.rbs +25 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/triggers.rbs +26 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/unique_constraints.rbs +26 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables/validations.rbs +26 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/tables.rbs +33 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas.rbs +30 -0
- data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations.rbs +47 -0
- data/sig/dynamic_migrations/postgres/server/database/differences.rbs +54 -0
- data/sig/dynamic_migrations/postgres/server/database/enums_loader.rbs +18 -0
- data/sig/dynamic_migrations/postgres/server/database/extensions_loader.rbs +17 -0
- data/sig/dynamic_migrations/postgres/server/database/keys_and_unique_constraints_loader.rbs +15 -0
- data/sig/dynamic_migrations/postgres/server/database/loaded_extensions.rbs +19 -0
- data/sig/dynamic_migrations/postgres/server/database/loaded_schemas.rbs +23 -0
- data/sig/dynamic_migrations/postgres/server/database/loaded_schemas_builder.rbs +27 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/enum.rbs +28 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/enums.rbs +31 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/function.rbs +30 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/functions.rbs +31 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/column.rbs +28 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/columns.rbs +30 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraint.rbs +55 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/foreign_key_constraints.rbs +32 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/index.rbs +62 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/indexes.rbs +31 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/primary_key.rbs +40 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/trigger.rbs +61 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/triggers.rbs +33 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/unique_constraint.rbs +49 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/unique_constraints.rbs +31 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/validation.rbs +43 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table/validations.rbs +31 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/table.rbs +38 -0
- data/sig/dynamic_migrations/postgres/server/database/schema/tables.rbs +28 -0
- data/sig/dynamic_migrations/postgres/server/database/schema.rbs +21 -0
- data/sig/dynamic_migrations/postgres/server/database/source.rbs +18 -0
- data/sig/dynamic_migrations/postgres/server/database/structure_loader.rbs +19 -0
- data/sig/dynamic_migrations/postgres/server/database/triggers_and_functions_loader.rbs +20 -0
- data/sig/dynamic_migrations/postgres/server/database/validations_loader.rbs +15 -0
- data/sig/dynamic_migrations/postgres/server/database.rbs +34 -0
- data/sig/dynamic_migrations/postgres/server.rbs +19 -0
- data/sig/dynamic_migrations/postgres.rbs +4 -0
- data/sig/dynamic_migrations.rbs +6 -0
- data/sig/pg.rbs +20 -0
- data/sig/tsort.rbs +3 -0
- metadata +93 -2
@@ -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
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
class Migration
|
8
|
+
type structure_template = {
|
9
|
+
header_comment: String,
|
10
|
+
methods: Array[Symbol],
|
11
|
+
}
|
12
|
+
self.@structure_templates: Array[structure_template]
|
13
|
+
|
14
|
+
def self.add_structure_template: (Array[Symbol] method_names, String header) -> void
|
15
|
+
def self.structure_templates: -> Array[structure_template]
|
16
|
+
attr_reader schema_name: Symbol?
|
17
|
+
attr_reader table_name: Symbol?
|
18
|
+
attr_reader fragments: Array[Fragment]
|
19
|
+
def initialize: (?Symbol? schema_name, ?Symbol? table_name) -> void
|
20
|
+
def add_fragment: (Fragment fragment) -> void
|
21
|
+
def dependencies: -> Array[{schema_name: Symbol, table_name: Symbol}]
|
22
|
+
def extract_fragments_with_dependency: (Symbol schema_name, Symbol table_name) -> Array[Fragment]
|
23
|
+
def content: -> String
|
24
|
+
def name: -> (:changes | :schema_functions | Symbol)
|
25
|
+
|
26
|
+
private
|
27
|
+
def supported_migration_method?: (Symbol method_name) -> bool
|
28
|
+
def fragments_for_method?: (:create_schema | :create_table | :drop_schema | :drop_table migration_method) -> bool
|
29
|
+
def first_fragment_using_migration_method: (:create_schema | :create_table | :drop_schema | :drop_table migration_method) -> Fragment
|
30
|
+
def all_fragments_for_method?: (Array[Symbol] migration_methods) -> untyped
|
31
|
+
|
32
|
+
class SectionNotFoundError < StandardError
|
33
|
+
end
|
34
|
+
|
35
|
+
class UnexpectedMigrationMethodNameError < StandardError
|
36
|
+
end
|
37
|
+
|
38
|
+
class DuplicateStructureTemplateError < StandardError
|
39
|
+
end
|
40
|
+
|
41
|
+
class NoFragmentsError < StandardError
|
42
|
+
end
|
43
|
+
|
44
|
+
class MissingRequiredTableName < StandardError
|
45
|
+
end
|
46
|
+
|
47
|
+
class MissingRequiredSchemaName < StandardError
|
48
|
+
end
|
49
|
+
|
50
|
+
class UnexpectedTableError < StandardError
|
51
|
+
end
|
52
|
+
|
53
|
+
class UnexpectedSchemaError < StandardError
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
module PrimaryKey
|
8
|
+
def add_primary_key: (Postgres::Server::Database::Schema::Table::PrimaryKey primary_key, ?String? code_comment) -> Fragment
|
9
|
+
def remove_primary_key: (Postgres::Server::Database::Schema::Table::PrimaryKey primary_key, ?String? code_comment) -> Fragment
|
10
|
+
def recreate_primary_key: (Postgres::Server::Database::Schema::Table::PrimaryKey original_primary_key, Postgres::Server::Database::Schema::Table::PrimaryKey updated_primary_key) -> Array[Fragment]
|
11
|
+
|
12
|
+
# these come from the generator object (which this module is included into)
|
13
|
+
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
|
14
|
+
|
15
|
+
def indent: (String migration, ?Integer levels) -> String
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
module Schema
|
8
|
+
def create_schema: (Postgres::Server::Database::Schema schema, ?String? code_comment) -> Fragment
|
9
|
+
def drop_schema: (Postgres::Server::Database::Schema schema, ?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
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
module Table
|
8
|
+
def create_table: (Postgres::Server::Database::Schema::Table table, ?String? code_comment) -> Fragment
|
9
|
+
def drop_table: (Postgres::Server::Database::Schema::Table table, ?String? code_comment) -> Fragment
|
10
|
+
def set_table_comment: (Postgres::Server::Database::Schema::Table table, ?String? code_comment) -> Fragment
|
11
|
+
def remove_table_comment: (Postgres::Server::Database::Schema::Table table, ?String? code_comment) -> Fragment
|
12
|
+
|
13
|
+
# these come from the generator object (which this module is included into)
|
14
|
+
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
|
15
|
+
|
16
|
+
def indent: (String migration, ?Integer levels) -> String
|
17
|
+
|
18
|
+
private
|
19
|
+
def table_columns: (Array[Postgres::Server::Database::Schema::Table::Column] columns) -> String
|
20
|
+
def table_options: (Postgres::Server::Database::Schema::Table table) -> String
|
21
|
+
|
22
|
+
class NoTableCommentError < StandardError
|
23
|
+
end
|
24
|
+
|
25
|
+
class NoTableColumnCommentError < StandardError
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
module Trigger
|
8
|
+
def add_trigger: (Server::Database::Schema::Table::Trigger trigger, ?String? code_comment) -> Fragment
|
9
|
+
def remove_trigger: (Server::Database::Schema::Table::Trigger trigger, ?String? code_comment) -> Fragment
|
10
|
+
def recreate_trigger: (Server::Database::Schema::Table::Trigger original_trigger, Server::Database::Schema::Table::Trigger updated_trigger) -> Array[Fragment]
|
11
|
+
def set_trigger_comment: (Postgres::Server::Database::Schema::Table::Trigger trigger, ?String? code_comment) -> Fragment
|
12
|
+
def remove_trigger_comment: (Postgres::Server::Database::Schema::Table::Trigger trigger, ?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
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
module UniqueConstraint
|
8
|
+
def add_unique_constraint: (Postgres::Server::Database::Schema::Table::UniqueConstraint unique_constraint, ?String? code_comment) -> Fragment
|
9
|
+
def remove_unique_constraint: (Postgres::Server::Database::Schema::Table::UniqueConstraint unique_constraint, ?String? code_comment) -> Fragment
|
10
|
+
def recreate_unique_constraint: (Postgres::Server::Database::Schema::Table::UniqueConstraint original_unique_constraint, Postgres::Server::Database::Schema::Table::UniqueConstraint updated_unique_constraint) -> Array[Fragment]
|
11
|
+
def set_unique_constraint_comment: (Postgres::Server::Database::Schema::Table::UniqueConstraint unique_constraint, ?String? code_comment) -> Fragment
|
12
|
+
def remove_unique_constraint_comment: (Postgres::Server::Database::Schema::Table::UniqueConstraint unique_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,21 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
module Validation
|
8
|
+
def add_validation: (Postgres::Server::Database::Schema::Table::Validation validation, ?String? code_comment) -> Fragment
|
9
|
+
def remove_validation: (Postgres::Server::Database::Schema::Table::Validation validation, ?String? code_comment) -> Fragment
|
10
|
+
def recreate_validation: (Postgres::Server::Database::Schema::Table::Validation original_validation, Postgres::Server::Database::Schema::Table::Validation updated_validation) -> Array[Fragment]
|
11
|
+
def set_validation_comment: (Postgres::Server::Database::Schema::Table::Validation validation, ?String? code_comment) -> Fragment
|
12
|
+
def remove_validation_comment: (Postgres::Server::Database::Schema::Table::Validation validation, ?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,57 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Generator
|
7
|
+
include TSort
|
8
|
+
|
9
|
+
@fragments: Array[Fragment]
|
10
|
+
|
11
|
+
include Schema
|
12
|
+
include Table
|
13
|
+
include Column
|
14
|
+
include ForeignKeyConstraint
|
15
|
+
include Index
|
16
|
+
include PrimaryKey
|
17
|
+
include UniqueConstraint
|
18
|
+
include Validation
|
19
|
+
include Function
|
20
|
+
include Trigger
|
21
|
+
|
22
|
+
def initialize: -> void
|
23
|
+
def migrations: -> Array[{
|
24
|
+
schema_name: Symbol,
|
25
|
+
name: Symbol,
|
26
|
+
content: String
|
27
|
+
}]
|
28
|
+
|
29
|
+
private
|
30
|
+
def circular_dependency?: (Symbol schema_name, Symbol table_name, {schema_name: Symbol, table_name: Symbol} dependency, Array[TableMigration] all_table_migrations) -> bool
|
31
|
+
def supported_migration_method?: (Symbol migration_method) -> bool
|
32
|
+
def add_fragment: (migration_method: Symbol, object: untyped, migration: String, ?schema: Server::Database::Schema?, ?table: Server::Database::Schema::Table?, ?code_comment: String?, ?dependent_table: nil | Server::Database::Schema::Table) -> Fragment
|
33
|
+
def indent: (String migration, ?Integer levels) -> String
|
34
|
+
def strip_empty_lines: (String migration) -> String
|
35
|
+
def tsort_each_node: -> Enumerator[untyped, untyped]
|
36
|
+
def tsort_each_child: (untyped node) -> untyped
|
37
|
+
|
38
|
+
class ExpectedSymbolError < StandardError
|
39
|
+
end
|
40
|
+
|
41
|
+
class DeferrableOptionsError < StandardError
|
42
|
+
end
|
43
|
+
|
44
|
+
class MissingDescriptionError < StandardError
|
45
|
+
end
|
46
|
+
|
47
|
+
class NoDifferenceError < StandardError
|
48
|
+
end
|
49
|
+
|
50
|
+
class TableMigrationNotFound < StandardError
|
51
|
+
end
|
52
|
+
|
53
|
+
class UnprocessableFragmentError < StandardError
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module DynamicMigrations
|
2
|
+
module Postgres
|
3
|
+
class Server
|
4
|
+
class Database
|
5
|
+
module ConfiguredExtensions
|
6
|
+
@configured_extensions: Hash[Symbol, true]
|
7
|
+
|
8
|
+
def add_configured_extension: (Symbol extension_name) -> void
|
9
|
+
def has_configured_extension?: (Symbol extension_name) -> bool
|
10
|
+
def configured_extensions: -> Array[Symbol]
|
11
|
+
|
12
|
+
class ConfiguredExtensionAlreadyExistsError < StandardError
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module DynamicMigrations
|
2
|
+
module Postgres
|
3
|
+
class Server
|
4
|
+
class Database
|
5
|
+
module ConfiguredSchemas
|
6
|
+
@configured_schemas: Hash[Symbol, Schema]
|
7
|
+
|
8
|
+
def add_configured_schema: (Symbol schema_name) -> Schema
|
9
|
+
def configured_schema: (Symbol schema_name) -> Schema
|
10
|
+
def has_configured_schema?: (Symbol schema_name) -> bool
|
11
|
+
def configured_schemas: -> Array[Schema]
|
12
|
+
def configured_schemas_hash: -> Hash[Symbol, Schema]
|
13
|
+
|
14
|
+
class ConfiguredSchemaAlreadyExistsError < StandardError
|
15
|
+
end
|
16
|
+
|
17
|
+
class ConfiguredSchemaDoesNotExistError < StandardError
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module DynamicMigrations
|
2
|
+
module Postgres
|
3
|
+
class Server
|
4
|
+
class Database
|
5
|
+
module Connection
|
6
|
+
@connection: PG::Connection | nil
|
7
|
+
|
8
|
+
def connect: -> PG::Connection
|
9
|
+
def connection: -> PG::Connection
|
10
|
+
def disconnect: -> void
|
11
|
+
def with_connection: -> void
|
12
|
+
|
13
|
+
# these come from the database object (which this module is included into)
|
14
|
+
def name: -> Symbol
|
15
|
+
def server: -> Server
|
16
|
+
|
17
|
+
class NotConnectedError < StandardError
|
18
|
+
end
|
19
|
+
|
20
|
+
class MissingDatabaseNameError < StandardError
|
21
|
+
end
|
22
|
+
|
23
|
+
class AlreadyConnectedError < StandardError
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Extensions
|
11
|
+
|
12
|
+
private
|
13
|
+
def process_extension: (Symbol extension_name, untyped configuration_extension, untyped database_extension) -> void
|
14
|
+
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/enums.rbs
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Schemas
|
11
|
+
module Enums
|
12
|
+
|
13
|
+
private
|
14
|
+
def process_enums: (Symbol schema_name, untyped configuration_enums, untyped database_enums) -> void
|
15
|
+
def process_enum: (Symbol schema_name, Symbol enum_name, untyped configuration_enum, untyped database_enum) -> void
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/sig/dynamic_migrations/postgres/server/database/differences/to_migrations/schemas/functions.rbs
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Schemas
|
11
|
+
module Functions
|
12
|
+
|
13
|
+
private
|
14
|
+
def process_functions: (Symbol schema_name, untyped configuration_functions, untyped database_functions) -> void
|
15
|
+
def process_function: (Symbol schema_name, Symbol function_name, untyped configuration_function, untyped database_function) -> void
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Schemas
|
11
|
+
module Tables
|
12
|
+
module Columns
|
13
|
+
|
14
|
+
private
|
15
|
+
def process_columns: (Symbol schema_name, Symbol table_name, untyped configuration_columns, untyped database_columns) -> void
|
16
|
+
def process_column: (Symbol schema_name, Symbol table_name, Symbol column_name, untyped configuration_column, untyped database_column) -> void
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Schemas
|
11
|
+
module Tables
|
12
|
+
module ForeignKeyConstraints
|
13
|
+
|
14
|
+
private
|
15
|
+
def process_foreign_key_constraints: (Symbol schema_name, Symbol table_name, untyped configuration_foreign_key_constraints, untyped database_foreign_key_constraints) -> void
|
16
|
+
def process_foreign_key_constraint: (Symbol schema_name, Symbol table_name, Symbol foreign_key_constraint_name, untyped configuration_foreign_key_constraint, untyped database_foreign_key_constraint) -> void
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Schemas
|
11
|
+
module Tables
|
12
|
+
module Indexes
|
13
|
+
|
14
|
+
private
|
15
|
+
def process_indexes: (Symbol schema_name, Symbol table_name, untyped configuration_indexes, untyped database_indexes) -> void
|
16
|
+
def process_index: (Symbol schema_name, Symbol table_name, Symbol index_name, untyped configuration_index, untyped database_index) -> void
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# TypeProf 0.21.7
|
2
|
+
|
3
|
+
# Classes
|
4
|
+
module DynamicMigrations
|
5
|
+
module Postgres
|
6
|
+
class Server
|
7
|
+
class Database
|
8
|
+
class Differences
|
9
|
+
class ToMigrations
|
10
|
+
module Schemas
|
11
|
+
module Tables
|
12
|
+
module PrimaryKey
|
13
|
+
|
14
|
+
private
|
15
|
+
def process_primary_key: (Symbol schema_name, Symbol table_name, untyped configuration_primary_key, untyped database_primary_key) -> void
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|