diff options
author | crupest <crupest@outlook.com> | 2020-06-14 00:21:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-14 00:21:25 +0800 |
commit | 1df83c67e999f7bcf606046c0c687a0be5f8d462 (patch) | |
tree | d073fc9162ab35e1d520f5888c83d4bc98a5ad05 /Timeline/Migrations/20200613135613_AddTimelineUniqueId.cs | |
parent | 41210c20cd6fef83530adbdaf5fb97e9f929ab6c (diff) | |
download | timeline-1df83c67e999f7bcf606046c0c687a0be5f8d462.tar.gz timeline-1df83c67e999f7bcf606046c0c687a0be5f8d462.tar.bz2 timeline-1df83c67e999f7bcf606046c0c687a0be5f8d462.zip |
refactor(back): Use a better way to handle unique id in timeline.
Diffstat (limited to 'Timeline/Migrations/20200613135613_AddTimelineUniqueId.cs')
-rw-r--r-- | Timeline/Migrations/20200613135613_AddTimelineUniqueId.cs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Timeline/Migrations/20200613135613_AddTimelineUniqueId.cs b/Timeline/Migrations/20200613135613_AddTimelineUniqueId.cs deleted file mode 100644 index fdca85b2..00000000 --- a/Timeline/Migrations/20200613135613_AddTimelineUniqueId.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations;
-
-namespace Timeline.Migrations
-{
- public partial class AddTimelineUniqueId : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql(
-@"
-ALTER TABLE timelines RENAME TO timelines_backup;
-
-CREATE TABLE timelines (
- id INTEGER NOT NULL CONSTRAINT PK_timelines PRIMARY KEY AUTOINCREMENT,
- unique_id TEXT NOT NULL DEFAULT (timeline_create_guid()),
- 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 timelines (id, name, description, owner, visibility, create_time)
- SELECT id, name, description, owner, visibility, create_time FROM timelines_backup;
-
-DROP TABLE timelines_backup;
-"
- );
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "unique_id",
- table: "timelines");
- }
- }
-}
|