From d934c1273bc20533683eaad858a1c499c7729a28 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 17 Dec 2020 20:08:33 +0800 Subject: ... --- .../20201217093401_AddHighlightTimelines.cs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 BackEnd/Timeline/Migrations/20201217093401_AddHighlightTimelines.cs (limited to 'BackEnd/Timeline/Migrations/20201217093401_AddHighlightTimelines.cs') diff --git a/BackEnd/Timeline/Migrations/20201217093401_AddHighlightTimelines.cs b/BackEnd/Timeline/Migrations/20201217093401_AddHighlightTimelines.cs new file mode 100644 index 00000000..e838615e --- /dev/null +++ b/BackEnd/Timeline/Migrations/20201217093401_AddHighlightTimelines.cs @@ -0,0 +1,55 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Timeline.Migrations +{ + public partial class AddHighlightTimelines : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "highlight_timelines", + columns: table => new + { + id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + timeline_id = table.Column(type: "INTEGER", nullable: false), + operator_id = table.Column(type: "INTEGER", nullable: true), + add_time = table.Column(type: "TEXT", nullable: false), + order = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_highlight_timelines", x => x.id); + table.ForeignKey( + name: "FK_highlight_timelines_timelines_timeline_id", + column: x => x.timeline_id, + principalTable: "timelines", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_highlight_timelines_users_operator_id", + column: x => x.operator_id, + principalTable: "users", + principalColumn: "id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_highlight_timelines_operator_id", + table: "highlight_timelines", + column: "operator_id"); + + migrationBuilder.CreateIndex( + name: "IX_highlight_timelines_timeline_id", + table: "highlight_timelines", + column: "timeline_id"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "highlight_timelines"); + } + } +} -- cgit v1.2.3