Added suuport to inject an IOqtaneDatabase in EntityBuilders to allow each Database to control certain Migration behaviors. Also updated Installer to dynamically build Database Configuration section

This commit is contained in:
Charles Nurse
2021-03-27 11:16:16 -07:00
parent 3a032f401a
commit 2fb63e8117
74 changed files with 1028 additions and 407 deletions

View File

@ -6,14 +6,6 @@ namespace Oqtane.Migrations.Extensions
{
public static class ColumnsBuilderExtensions
{
public static OperationBuilder<AddColumnOperation> AddAutoIncrementColumn(this ColumnsBuilder table, string name)
{
return table.Column<int>(name: name, nullable: false)
.Annotation("SqlServer:Identity", "1, 1")
.Annotation("Sqlite:Autoincrement", true)
.Annotation("MySql:ValueGeneratedOnAdd", true);
}
public static OperationBuilder<AddColumnOperation> AddBooleanColumn(this ColumnsBuilder table, string name, bool nullable = false)
{
return table.Column<bool>(name: name, nullable: nullable);
@ -36,12 +28,12 @@ namespace Oqtane.Migrations.Extensions
public static OperationBuilder<AddColumnOperation> AddMaxStringColumn(this ColumnsBuilder table, string name, bool nullable = false)
{
return table.Column<string>(name: name, nullable: nullable);
return table.Column<string>(name: name, nullable: nullable, unicode: true);
}
public static OperationBuilder<AddColumnOperation> AddStringColumn(this ColumnsBuilder table, string name, int length, bool nullable = false)
{
return table.Column<string>(name: name, maxLength: length, nullable: nullable);
return table.Column<string>(name: name, maxLength: length, nullable: nullable, unicode: true);
}
}