aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Migrations/20190822072156_AddUserDetail.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-22 15:29:03 +0800
committerGitHub <noreply@github.com>2019-08-22 15:29:03 +0800
commit3716d2431de08194d3a107ef640febc47c3ee72a (patch)
treeaf83f8596b4fa78713733c0db6b4b6d1695d0ff0 /Timeline/Migrations/20190822072156_AddUserDetail.cs
parenta585c6e35829e9f2b4b0b8ce8c6b395e5ea84f2c (diff)
parent968f9688dd3ff7cae6f66af0e69bb03392311c88 (diff)
downloadtimeline-3716d2431de08194d3a107ef640febc47c3ee72a.tar.gz
timeline-3716d2431de08194d3a107ef640febc47c3ee72a.tar.bz2
timeline-3716d2431de08194d3a107ef640febc47c3ee72a.zip
Merge pull request #48 from crupest/user-details
Add user details.
Diffstat (limited to 'Timeline/Migrations/20190822072156_AddUserDetail.cs')
-rw-r--r--Timeline/Migrations/20190822072156_AddUserDetail.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/Timeline/Migrations/20190822072156_AddUserDetail.cs b/Timeline/Migrations/20190822072156_AddUserDetail.cs
new file mode 100644
index 00000000..4aa6446b
--- /dev/null
+++ b/Timeline/Migrations/20190822072156_AddUserDetail.cs
@@ -0,0 +1,47 @@
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Timeline.Migrations
+{
+ public partial class AddUserDetail : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "user_details",
+ columns: table => new
+ {
+ id = table.Column<long>(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ nickname = table.Column<string>(maxLength: 15, nullable: true),
+ qq = table.Column<string>(maxLength: 15, nullable: true),
+ email = table.Column<string>(maxLength: 50, nullable: true),
+ phone_number = table.Column<string>(maxLength: 15, nullable: true),
+ description = table.Column<string>(nullable: true),
+ UserId = table.Column<long>(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_user_details", x => x.id);
+ table.ForeignKey(
+ name: "FK_user_details_users_UserId",
+ column: x => x.UserId,
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_user_details_UserId",
+ table: "user_details",
+ column: "UserId",
+ unique: true);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "user_details");
+ }
+ }
+}