aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-21 11:59:58 +0800
committercrupest <crupest@outlook.com>2020-02-21 11:59:58 +0800
commit3fa9899e17df4b1012e8b645915ac15022b84f9b (patch)
treea143ff8698660608d188428957a1ad56d620cca6 /Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs
parent1fe7642e88d373d8ed00a434cd7c73af422c261a (diff)
downloadtimeline-3fa9899e17df4b1012e8b645915ac15022b84f9b.tar.gz
timeline-3fa9899e17df4b1012e8b645915ac15022b84f9b.tar.bz2
timeline-3fa9899e17df4b1012e8b645915ac15022b84f9b.zip
Migrate to use sqlite.
Diffstat (limited to 'Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs')
-rw-r--r--Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs229
1 files changed, 0 insertions, 229 deletions
diff --git a/Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs b/Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs
deleted file mode 100644
index 9b80ad30..00000000
--- a/Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-namespace Timeline.Migrations.ProductionDatabase
-{
- public partial class InitTimeline : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "roles",
- table: "users",
- nullable: false,
- oldClrType: typeof(string),
- oldType: "longtext");
-
- migrationBuilder.AlterColumn<string>(
- name: "name",
- table: "users",
- maxLength: 26,
- nullable: false,
- oldClrType: typeof(string),
- oldType: "varchar(26)",
- oldMaxLength: 26);
-
- migrationBuilder.AlterColumn<string>(
- name: "password",
- table: "users",
- nullable: false,
- oldClrType: typeof(string),
- oldType: "longtext");
-
- migrationBuilder.AlterColumn<string>(
- name: "nickname",
- table: "user_details",
- maxLength: 26,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "varchar(26)",
- oldMaxLength: 26,
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "type",
- table: "user_avatars",
- nullable: true,
- oldClrType: typeof(string),
- oldType: "longtext",
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "etag",
- table: "user_avatars",
- maxLength: 30,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "varchar(30)",
- oldMaxLength: 30,
- oldNullable: true);
-
- migrationBuilder.CreateTable(
- name: "timelines",
- columns: table => new
- {
- id = table.Column<long>(nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
- name = table.Column<string>(nullable: true),
- description = table.Column<string>(nullable: true),
- owner = table.Column<long>(nullable: false),
- visibility = table.Column<int>(nullable: false),
- create_time = table.Column<DateTime>(nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_timelines", x => x.id);
- table.ForeignKey(
- name: "FK_timelines_users_owner",
- column: x => x.owner,
- principalTable: "users",
- principalColumn: "id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "timeline_posts",
- columns: table => new
- {
- id = table.Column<long>(nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
- timeline = table.Column<long>(nullable: false),
- author = table.Column<long>(nullable: false),
- content = table.Column<string>(nullable: true),
- time = table.Column<DateTime>(nullable: false),
- last_updated = table.Column<DateTime>(nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_timeline_posts", x => x.id);
- table.ForeignKey(
- name: "FK_timeline_posts_users_author",
- column: x => x.author,
- principalTable: "users",
- principalColumn: "id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_timeline_posts_timelines_timeline",
- column: x => x.timeline,
- principalTable: "timelines",
- principalColumn: "id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "TimelineMembers",
- columns: table => new
- {
- id = table.Column<long>(nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
- user = table.Column<long>(nullable: false),
- timeline = table.Column<long>(nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TimelineMembers", x => x.id);
- table.ForeignKey(
- name: "FK_TimelineMembers_timelines_timeline",
- column: x => x.timeline,
- principalTable: "timelines",
- principalColumn: "id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_TimelineMembers_users_user",
- column: x => x.user,
- principalTable: "users",
- principalColumn: "id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_timeline_posts_author",
- table: "timeline_posts",
- column: "author");
-
- migrationBuilder.CreateIndex(
- name: "IX_timeline_posts_timeline",
- table: "timeline_posts",
- column: "timeline");
-
- migrationBuilder.CreateIndex(
- name: "IX_TimelineMembers_timeline",
- table: "TimelineMembers",
- column: "timeline");
-
- migrationBuilder.CreateIndex(
- name: "IX_TimelineMembers_user",
- table: "TimelineMembers",
- column: "user");
-
- migrationBuilder.CreateIndex(
- name: "IX_timelines_owner",
- table: "timelines",
- column: "owner");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "timeline_posts");
-
- migrationBuilder.DropTable(
- name: "TimelineMembers");
-
- migrationBuilder.DropTable(
- name: "timelines");
-
- migrationBuilder.AlterColumn<string>(
- name: "roles",
- table: "users",
- type: "longtext",
- nullable: false,
- oldClrType: typeof(string));
-
- migrationBuilder.AlterColumn<string>(
- name: "name",
- table: "users",
- type: "varchar(26)",
- maxLength: 26,
- nullable: false,
- oldClrType: typeof(string),
- oldMaxLength: 26);
-
- migrationBuilder.AlterColumn<string>(
- name: "password",
- table: "users",
- type: "longtext",
- nullable: false,
- oldClrType: typeof(string));
-
- migrationBuilder.AlterColumn<string>(
- name: "nickname",
- table: "user_details",
- type: "varchar(26)",
- maxLength: 26,
- nullable: true,
- oldClrType: typeof(string),
- oldMaxLength: 26,
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "type",
- table: "user_avatars",
- type: "longtext",
- nullable: true,
- oldClrType: typeof(string),
- oldNullable: true);
-
- migrationBuilder.AlterColumn<string>(
- name: "etag",
- table: "user_avatars",
- type: "varchar(30)",
- maxLength: 30,
- nullable: true,
- oldClrType: typeof(string),
- oldMaxLength: 30,
- oldNullable: true);
- }
- }
-}