summaryrefslogtreecommitdiff
path: root/Migrations/20231009045945_SecurityRevision.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2023-10-09 16:00:18 +1100
committerJake Mannens <jake@asger.xyz>2023-10-09 16:00:18 +1100
commit299e58db28202be8706dee1c570c382e1489213b (patch)
tree9276a024702e7596cd58c72337c29955fafa98e2 /Migrations/20231009045945_SecurityRevision.cs
parent2c30354c4af308bf9856a3651d9ba3a686eed936 (diff)
AclDialog
Diffstat (limited to 'Migrations/20231009045945_SecurityRevision.cs')
-rw-r--r--Migrations/20231009045945_SecurityRevision.cs63
1 files changed, 63 insertions, 0 deletions
diff --git a/Migrations/20231009045945_SecurityRevision.cs b/Migrations/20231009045945_SecurityRevision.cs
new file mode 100644
index 0000000..03fbd60
--- /dev/null
+++ b/Migrations/20231009045945_SecurityRevision.cs
@@ -0,0 +1,63 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace HyperBooru.Migrations
+{
+ /// <inheritdoc />
+ public partial class SecurityRevision : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn<string>(
+ name: "DisplayName",
+ table: "SecurityPrincipals",
+ type: "text",
+ nullable: false,
+ defaultValue: "");
+
+ migrationBuilder.AlterColumn<byte[]>(
+ name: "Owner",
+ table: "Objects",
+ type: "bytea",
+ nullable: false,
+ defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
+ oldClrType: typeof(byte[]),
+ oldType: "bytea",
+ oldDefaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
+
+ migrationBuilder.UpdateData(
+ table: "SecurityPrincipals",
+ keyColumn: "LocalPrincipalId",
+ keyValue: -1,
+ columns: new[] { "DisplayName", "Name" },
+ values: new object[] { "Administrator", "Administrator" });
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "DisplayName",
+ table: "SecurityPrincipals");
+
+ migrationBuilder.AlterColumn<byte[]>(
+ name: "Owner",
+ table: "Objects",
+ type: "bytea",
+ nullable: false,
+ defaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
+ oldClrType: typeof(byte[]),
+ oldType: "bytea",
+ oldDefaultValue: new byte[] { 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 });
+
+ migrationBuilder.UpdateData(
+ table: "SecurityPrincipals",
+ keyColumn: "LocalPrincipalId",
+ keyValue: -1,
+ column: "Name",
+ value: "admin");
+ }
+ }
+}