From ac769e656b122ff569c3f1534701b71e00fed586 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Oct 2020 19:21:35 +0800 Subject: Split front and back end. --- .../20200614061237_AddTimelineUniqueId.cs | 50 ---------------------- 1 file changed, 50 deletions(-) delete mode 100644 Timeline/Migrations/20200614061237_AddTimelineUniqueId.cs (limited to 'Timeline/Migrations/20200614061237_AddTimelineUniqueId.cs') diff --git a/Timeline/Migrations/20200614061237_AddTimelineUniqueId.cs b/Timeline/Migrations/20200614061237_AddTimelineUniqueId.cs deleted file mode 100644 index 7abbed79..00000000 --- a/Timeline/Migrations/20200614061237_AddTimelineUniqueId.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Timeline.Migrations -{ - public partial class AddTimelineUniqueId : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.Sql( -@" -PRAGMA foreign_keys=OFF; - -BEGIN TRANSACTION; - -CREATE TABLE new_timelines ( - id INTEGER NOT NULL CONSTRAINT PK_timelines PRIMARY KEY AUTOINCREMENT, - unique_id TEXT NOT NULL DEFAULT (lower(hex(randomblob(16)))), - name TEXT NULL, - description TEXT NULL, - owner INTEGER NOT NULL, - visibility INTEGER NOT NULL, - create_time TEXT NOT NULL, - current_post_local_id INTEGER NOT NULL DEFAULT 0, - CONSTRAINT FK_timelines_users_owner FOREIGN KEY (owner) REFERENCES users (id) ON DELETE CASCADE -); - -INSERT INTO new_timelines (id, name, description, owner, visibility, create_time, current_post_local_id) - SELECT id, name, description, owner, visibility, create_time, current_post_local_id FROM timelines; - -DROP TABLE timelines; - -ALTER TABLE new_timelines - RENAME TO timelines; - -CREATE INDEX IX_timelines_owner ON timelines (owner); - -PRAGMA foreign_key_check; - -COMMIT TRANSACTION; - -PRAGMA foreign_keys=ON; -" - , true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - } - } -} -- cgit v1.2.3