From 3fa9899e17df4b1012e8b645915ac15022b84f9b Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 21 Feb 2020 11:59:58 +0800 Subject: Migrate to use sqlite. --- .../20191120104512_InitTimeline.cs | 229 --------------------- 1 file changed, 229 deletions(-) delete mode 100644 Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs (limited to 'Timeline/Migrations/ProductionDatabase/20191120104512_InitTimeline.cs') 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( - name: "roles", - table: "users", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext"); - - migrationBuilder.AlterColumn( - name: "name", - table: "users", - maxLength: 26, - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(26)", - oldMaxLength: 26); - - migrationBuilder.AlterColumn( - name: "password", - table: "users", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext"); - - migrationBuilder.AlterColumn( - name: "nickname", - table: "user_details", - maxLength: 26, - nullable: true, - oldClrType: typeof(string), - oldType: "varchar(26)", - oldMaxLength: 26, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "type", - table: "user_avatars", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true); - - migrationBuilder.AlterColumn( - 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(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - name = table.Column(nullable: true), - description = table.Column(nullable: true), - owner = table.Column(nullable: false), - visibility = table.Column(nullable: false), - create_time = table.Column(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(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - timeline = table.Column(nullable: false), - author = table.Column(nullable: false), - content = table.Column(nullable: true), - time = table.Column(nullable: false), - last_updated = table.Column(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(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - user = table.Column(nullable: false), - timeline = table.Column(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( - name: "roles", - table: "users", - type: "longtext", - nullable: false, - oldClrType: typeof(string)); - - migrationBuilder.AlterColumn( - name: "name", - table: "users", - type: "varchar(26)", - maxLength: 26, - nullable: false, - oldClrType: typeof(string), - oldMaxLength: 26); - - migrationBuilder.AlterColumn( - name: "password", - table: "users", - type: "longtext", - nullable: false, - oldClrType: typeof(string)); - - migrationBuilder.AlterColumn( - name: "nickname", - table: "user_details", - type: "varchar(26)", - maxLength: 26, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 26, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "type", - table: "user_avatars", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "etag", - table: "user_avatars", - type: "varchar(30)", - maxLength: 30, - nullable: true, - oldClrType: typeof(string), - oldMaxLength: 30, - oldNullable: true); - } - } -} -- cgit v1.2.3