Note that I had to remove the view from the table manually, otherwise I could not update the database.
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace EntityFrameworkCore.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddRestriction : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Name",
|
|
table: "Teams",
|
|
type: "TEXT",
|
|
maxLength: 100,
|
|
nullable: false,
|
|
defaultValue: "",
|
|
oldClrType: typeof(string),
|
|
oldType: "TEXT",
|
|
oldNullable: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Name",
|
|
table: "Teams",
|
|
type: "TEXT",
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "TEXT",
|
|
oldMaxLength: 100);
|
|
}
|
|
}
|
|
}
|