diff options
author | crupest <crupest@outlook.com> | 2019-04-12 23:34:40 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-12 23:34:40 +0800 |
commit | 1d184c3f41da806803c1ee792395eabcd155077d (patch) | |
tree | 0fa205ca1c58766101ae7f6c78be5ff2d77a0f28 /Timeline/Migrations/20190412153003_MakeColumnsInUserNotNull.cs | |
parent | 19cae15eba2bcede41b818e1b8ab7fd5ac92eb05 (diff) | |
download | timeline-1d184c3f41da806803c1ee792395eabcd155077d.tar.gz timeline-1d184c3f41da806803c1ee792395eabcd155077d.tar.bz2 timeline-1d184c3f41da806803c1ee792395eabcd155077d.zip |
Add database connection.
Diffstat (limited to 'Timeline/Migrations/20190412153003_MakeColumnsInUserNotNull.cs')
-rw-r--r-- | Timeline/Migrations/20190412153003_MakeColumnsInUserNotNull.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Timeline/Migrations/20190412153003_MakeColumnsInUserNotNull.cs b/Timeline/Migrations/20190412153003_MakeColumnsInUserNotNull.cs new file mode 100644 index 00000000..0b7b5f08 --- /dev/null +++ b/Timeline/Migrations/20190412153003_MakeColumnsInUserNotNull.cs @@ -0,0 +1,52 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Timeline.Migrations +{ + public partial class MakeColumnsInUserNotNull : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn<string>( + name: "roles", + table: "user", + nullable: false, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn<string>( + name: "name", + table: "user", + nullable: false, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn<string>( + name: "password", + table: "user", + nullable: false, + oldClrType: typeof(string), + oldNullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn<string>( + name: "roles", + table: "user", + nullable: true, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn<string>( + name: "name", + table: "user", + nullable: true, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn<string>( + name: "password", + table: "user", + nullable: true, + oldClrType: typeof(string)); + } + } +} |