Class NpgsqlMigrationsSqlGenerator
PostgreSQL-specific implementation of
Inheritance
Namespace: Npgsql.EntityFrameworkCore.PostgreSQL.Migrations
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
Syntax
public class NpgsqlMigrationsSqlGenerator : MigrationsSqlGenerator
Remarks
The service lifetime is
See Database migrations.
Constructors
| Improve this Doc View SourceNpgsqlMigrationsSqlGenerator(MigrationsSqlGeneratorDependencies, INpgsqlSingletonOptions)
Creates a new NpgsqlMigrationsSqlGenerator instance.
Declaration
public NpgsqlMigrationsSqlGenerator(MigrationsSqlGeneratorDependencies dependencies, INpgsqlSingletonOptions npgsqlSingletonOptions)
Parameters
Type | Name | Description |
---|---|---|
MigrationsSqlGeneratorDependencies | dependencies | Parameter object containing dependencies for this service. |
INpgsqlSingletonOptions | npgsqlSingletonOptions | The singleton options to use. |
Remarks
The service lifetime is
See Database migrations.
Methods
| Improve this Doc View SourceApplyTsVectorColumnSql(ColumnOperation, IModel?, string, string?, string)
Checks for a TsVectorConfig annotation on the given column, and if found, assigns
the appropriate SQL to
Declaration
protected virtual void ApplyTsVectorColumnSql(ColumnOperation column, IModel? model, string name, string? schema, string table)
Parameters
Type | Name | Description |
---|---|---|
ColumnOperation | column | |
IModel? | model | |
string | name | |
string? | schema | |
string | table |
Remarks
The service lifetime is
See Database migrations.
ColumnDefinition(string?, string, string, ColumnOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void ColumnDefinition(string? schema, string table, string name, ColumnOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
string? | schema | |
string | table | |
string | name | |
ColumnOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
ComputedColumnDefinition(string?, string, string, ColumnOperation, IModel?, MigrationCommandListBuilder)
Generates a SQL fragment for a computed column definition for the given column metadata.
Declaration
protected override void ComputedColumnDefinition(string? schema, string table, string name, ColumnOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
string? | schema | The schema that contains the table, or |
string | table | The table that contains the column. |
string | name | The column name. |
ColumnOperation | operation | The column metadata. |
IModel? | model | The target model which may be |
MigrationCommandListBuilder | builder | The command builder to use to add the SQL fragment. |
Remarks
The service lifetime is
See Database migrations.
Generate(AddColumnOperation, IModel?, MigrationCommandListBuilder, bool)
Declaration
protected override void Generate(AddColumnOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
Parameters
Type | Name | Description |
---|---|---|
AddColumnOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder | |
bool | terminate |
Remarks
The service lifetime is
See Database migrations.
Generate(AlterColumnOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(AlterColumnOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AlterColumnOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(AlterDatabaseOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(AlterDatabaseOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AlterDatabaseOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(AlterTableOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(AlterTableOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AlterTableOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(CreateIndexOperation, IModel?, MigrationCommandListBuilder, bool)
Declaration
protected override void Generate(CreateIndexOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
Parameters
Type | Name | Description |
---|---|---|
CreateIndexOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder | |
bool | terminate |
Remarks
The service lifetime is
See Database migrations.
Generate(CreateSequenceOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(CreateSequenceOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
CreateSequenceOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(CreateTableOperation, IModel?, MigrationCommandListBuilder, bool)
Declaration
protected override void Generate(CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
Parameters
Type | Name | Description |
---|---|---|
CreateTableOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder | |
bool | terminate |
Remarks
The service lifetime is
See Database migrations.
Generate(DropColumnOperation, IModel?, MigrationCommandListBuilder, bool)
Declaration
protected override void Generate(DropColumnOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
Parameters
Type | Name | Description |
---|---|---|
DropColumnOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder | |
bool | terminate |
Remarks
The service lifetime is
See Database migrations.
Generate(DropIndexOperation, IModel?, MigrationCommandListBuilder, bool)
Declaration
protected override void Generate(DropIndexOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
Parameters
Type | Name | Description |
---|---|---|
DropIndexOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder | |
bool | terminate |
Remarks
The service lifetime is
See Database migrations.
Generate(EnsureSchemaOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(EnsureSchemaOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
EnsureSchemaOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(InsertDataOperation, IModel?, MigrationCommandListBuilder, bool)
Builds commands for the given
Declaration
protected override void Generate(InsertDataOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
Parameters
Type | Name | Description |
---|---|---|
InsertDataOperation | operation | The operation. |
IModel? | model | The target model which may be |
MigrationCommandListBuilder | builder | The command builder to use to build the commands. |
bool | terminate | Indicates whether or not to terminate the command after generating SQL for the operation. |
Remarks
The service lifetime is
See Database migrations.
Generate(IReadOnlyList<MigrationOperation>, IModel?, MigrationsSqlGenerationOptions)
Declaration
public override IReadOnlyList<MigrationCommand> Generate(IReadOnlyList<MigrationOperation> operations, IModel? model = null, MigrationsSqlGenerationOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<><MigrationOperation> | operations | |
IModel? | model | |
MigrationsSqlGenerationOptions | options |
Returns
Type | Description |
---|---|
IReadOnlyList<><MigrationCommand> |
Remarks
The service lifetime is
See Database migrations.
Generate(MigrationOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(MigrationOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
MigrationOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(NpgsqlCreateDatabaseOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void Generate(NpgsqlCreateDatabaseOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlCreateDatabaseOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(NpgsqlDropDatabaseOperation, IModel?, MigrationCommandListBuilder)
Declaration
public virtual void Generate(NpgsqlDropDatabaseOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlDropDatabaseOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(RenameColumnOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(RenameColumnOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
RenameColumnOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(RenameIndexOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(RenameIndexOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
RenameIndexOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(RenameSequenceOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(RenameSequenceOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
RenameSequenceOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Generate(RenameTableOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void Generate(RenameTableOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
RenameTableOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateAddEnumLabel(PostgresEnum, string, string?, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateAddEnumLabel(PostgresEnum enumType, string addedLabel, string? beforeLabel, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresEnum | enumType | |
string | addedLabel | |
string? | beforeLabel | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateCollationStatements(AlterDatabaseOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateCollationStatements(AlterDatabaseOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AlterDatabaseOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateCreateCollation(PostgresCollation, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateCreateCollation(PostgresCollation collation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresCollation | collation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateCreateEnum(PostgresEnum, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateCreateEnum(PostgresEnum enumType, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresEnum | enumType | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateCreateExtension(PostgresExtension, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateCreateExtension(PostgresExtension extension, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresExtension | extension | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateCreateRange(PostgresRange, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateCreateRange(PostgresRange rangeType, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresRange | rangeType | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateDropCollation(PostgresCollation, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateDropCollation(PostgresCollation collation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresCollation | collation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateDropEnum(PostgresEnum, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateDropEnum(PostgresEnum enumType, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresEnum | enumType | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateDropRange(PostgresRange, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateDropRange(PostgresRange rangeType, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
PostgresRange | rangeType | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateEnumStatements(AlterDatabaseOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateEnumStatements(AlterDatabaseOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AlterDatabaseOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
GenerateRangeStatements(AlterDatabaseOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected virtual void GenerateRangeStatements(AlterDatabaseOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AlterDatabaseOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
IdentityDefinition(ColumnOperation, MigrationCommandListBuilder)
Declaration
protected virtual void IdentityDefinition(ColumnOperation operation, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
ColumnOperation | operation | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
IndexOptions(CreateIndexOperation, IModel?, MigrationCommandListBuilder)
Declaration
protected override void IndexOptions(CreateIndexOperation operation, IModel? model, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
CreateIndexOperation | operation | |
IModel? | model | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
RecreateIndexes(IColumn?, MigrationOperation, MigrationCommandListBuilder)
Declaration
protected virtual void RecreateIndexes(IColumn? column, MigrationOperation currentOperation, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IColumn? | column | |
MigrationOperation | currentOperation | |
MigrationCommandListBuilder | builder |
Remarks
The service lifetime is
See Database migrations.
Rename(string?, string, string, string, MigrationCommandListBuilder)
Renames a database object such as a table, index, or sequence.
Declaration
public virtual void Rename(string? schema, string name, string newName, string type, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
string? | schema | The current schema of the object to rename. |
string | name | The current name of the object to rename. |
string | newName | The new name. |
string | type | The type of the object (e.g. TABLE, INDEX, SEQUENCE). |
MigrationCommandListBuilder | builder | The builder to which operations are appended. |
Remarks
The service lifetime is
See Database migrations.
Transfer(string, string?, string, string, MigrationCommandListBuilder)
Transfers a database object such as a table, index, or sequence between schemas.
Declaration
public virtual void Transfer(string newSchema, string? schema, string name, string type, MigrationCommandListBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
string | newSchema | The new schema. |
string? | schema | The current schema. |
string | name | The name of the object to transfer. |
string | type | The type of the object (e.g. TABLE, INDEX, SEQUENCE). |
MigrationCommandListBuilder | builder | The builder to which operations are appended. |
Remarks
The service lifetime is
See Database migrations.