diff options
author | crupest <crupest@outlook.com> | 2020-11-13 16:20:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 16:20:45 +0800 |
commit | 381cb7c64123c71899f549baa16bb610cc8b037f (patch) | |
tree | dfb4dd690704e887e3609265e6a652fe7ccea218 /BackEnd/Timeline/Migrations/20201112084015_AddUserPermission.cs | |
parent | 5b78017e93450342c85a0e7f5ed16bbb6ae8422e (diff) | |
parent | b635b4453756d9a33c173c9b9f2ae0ab7c830d3b (diff) | |
download | timeline-381cb7c64123c71899f549baa16bb610cc8b037f.tar.gz timeline-381cb7c64123c71899f549baa16bb610cc8b037f.tar.bz2 timeline-381cb7c64123c71899f549baa16bb610cc8b037f.zip |
Merge pull request #183 from crupest/auth
Refactor auth module to enable more flexiable permission control.
Diffstat (limited to 'BackEnd/Timeline/Migrations/20201112084015_AddUserPermission.cs')
-rw-r--r-- | BackEnd/Timeline/Migrations/20201112084015_AddUserPermission.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Migrations/20201112084015_AddUserPermission.cs b/BackEnd/Timeline/Migrations/20201112084015_AddUserPermission.cs new file mode 100644 index 00000000..b2288374 --- /dev/null +++ b/BackEnd/Timeline/Migrations/20201112084015_AddUserPermission.cs @@ -0,0 +1,41 @@ +using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Timeline.Migrations
+{
+ public partial class AddUserPermission : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "user_permission",
+ columns: table => new
+ {
+ id = table.Column<long>(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ user_id = table.Column<long>(type: "INTEGER", nullable: false),
+ permission = table.Column<string>(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_user_permission", x => x.id);
+ table.ForeignKey(
+ name: "FK_user_permission_users_user_id",
+ column: x => x.user_id,
+ principalTable: "users",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_user_permission_user_id",
+ table: "user_permission",
+ column: "user_id");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "user_permission");
+ }
+ }
+}
|