diff options
author | crupest <crupest@outlook.com> | 2020-10-31 00:42:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 00:42:06 +0800 |
commit | a3c97f6fb6313da2e8c0fac0b4c08f2ef4265d0f (patch) | |
tree | ee006874b0c93e9bfc76f141a092a8b9585a1f95 /Timeline/Migrations/20200810155908_AddTimesToUser.cs | |
parent | 0c4caaebe2480e77918d5d7df234f0edaeab74ba (diff) | |
parent | 7ce0846d9ec968da3ea4f7ebcc6db26db8e49089 (diff) | |
download | timeline-a3c97f6fb6313da2e8c0fac0b4c08f2ef4265d0f.tar.gz timeline-a3c97f6fb6313da2e8c0fac0b4c08f2ef4265d0f.tar.bz2 timeline-a3c97f6fb6313da2e8c0fac0b4c08f2ef4265d0f.zip |
Merge pull request #161 from crupest/upgrade
Upgrade packages and split front end and back end.
Diffstat (limited to 'Timeline/Migrations/20200810155908_AddTimesToUser.cs')
-rw-r--r-- | Timeline/Migrations/20200810155908_AddTimesToUser.cs | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/Timeline/Migrations/20200810155908_AddTimesToUser.cs b/Timeline/Migrations/20200810155908_AddTimesToUser.cs deleted file mode 100644 index 369f85e6..00000000 --- a/Timeline/Migrations/20200810155908_AddTimesToUser.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-namespace Timeline.Migrations
-{
- public partial class AddTimesToUser : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.Sql(
-@"
-PRAGMA foreign_keys=OFF;
-
-BEGIN TRANSACTION;
-
-CREATE TABLE new_users (
- id INTEGER NOT NULL
- CONSTRAINT PK_users PRIMARY KEY AUTOINCREMENT,
- unique_id TEXT NOT NULL DEFAULT (lower(hex(randomblob(16)))),
- username TEXT NOT NULL,
- password TEXT NOT NULL,
- roles TEXT NOT NULL,
- version INTEGER NOT NULL
- DEFAULT 0,
- nickname TEXT,
- create_time TEXT NOT NULL DEFAULT (datetime('now', 'utc')),
- last_modified TEXT NOT NULL DEFAULT (datetime('now', 'utc')),
- username_change_time TEXT NOT NULL DEFAULT (datetime('now', 'utc'))
-);
-
-INSERT INTO new_users (id, unique_id, username, password, roles, version, nickname)
- SELECT id, unique_id, username, password, roles, version, nickname FROM users;
-
-DROP TABLE users;
-
-ALTER TABLE new_users
- RENAME TO users;
-
-CREATE UNIQUE INDEX IX_users_username ON users (
- username
-);
-
-PRAGMA foreign_key_check;
-
-COMMIT TRANSACTION;
-
-PRAGMA foreign_keys=ON;
-"
-, true);
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "create_time",
- table: "users");
-
- migrationBuilder.DropColumn(
- name: "last_modified",
- table: "users");
-
- migrationBuilder.DropColumn(
- name: "username_change_time",
- table: "users");
- }
- }
-}
|