aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-19 20:09:52 +0800
committercrupest <crupest@outlook.com>2020-12-19 20:09:52 +0800
commit682b5a076c967f9f38dd32c0cffd4010548bd400 (patch)
tree8dba18b84d996f1396423788525390fdde301210 /BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs
parentcf8a869de33cfa5db1967698059abccaaeaba4c9 (diff)
downloadtimeline-682b5a076c967f9f38dd32c0cffd4010548bd400.tar.gz
timeline-682b5a076c967f9f38dd32c0cffd4010548bd400.tar.bz2
timeline-682b5a076c967f9f38dd32c0cffd4010548bd400.zip
feat(database): Add migration,
Diffstat (limited to 'BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs')
-rw-r--r--BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs b/BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs
new file mode 100644
index 00000000..571d0419
--- /dev/null
+++ b/BackEnd/Timeline/Migrations/20201219120929_AddBookmarkTimeline.cs
@@ -0,0 +1,53 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Timeline.Migrations
+{
+ public partial class AddBookmarkTimeline : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "bookmark_timelines",
+ columns: table => new
+ {
+ id = table.Column<long>(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ timeline = table.Column<long>(type: "INTEGER", nullable: false),
+ user = table.Column<long>(type: "INTEGER", nullable: false),
+ rank = table.Column<long>(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_bookmark_timelines", x => x.id);
+ table.ForeignKey(
+ name: "FK_bookmark_timelines_timelines_timeline",
+ column: x => x.timeline,
+ principalTable: "timelines",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_bookmark_timelines_users_user",
+ column: x => x.user,
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_bookmark_timelines_timeline",
+ table: "bookmark_timelines",
+ column: "timeline");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_bookmark_timelines_user",
+ table: "bookmark_timelines",
+ column: "user");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "bookmark_timelines");
+ }
+ }
+}