From e8e3c4cba8ffa0056e984c113cfbb75319e00022 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Fri, 20 Sep 2024 16:21:09 +1000 Subject: v0.4-rc1 --- Migrations/20241011050136_v0.4-rc1.cs | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Migrations/20241011050136_v0.4-rc1.cs (limited to 'Migrations/20241011050136_v0.4-rc1.cs') diff --git a/Migrations/20241011050136_v0.4-rc1.cs b/Migrations/20241011050136_v0.4-rc1.cs new file mode 100644 index 0000000..6278225 --- /dev/null +++ b/Migrations/20241011050136_v0.4-rc1.cs @@ -0,0 +1,67 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace PagerParser.Migrations +{ + /// + public partial class v04rc1 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "DiscordAlertChannels", + columns: table => new + { + DiscordAlertChannelId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + GuildId = table.Column(type: "numeric(20,0)", nullable: false), + ChannelId = table.Column(type: "numeric(20,0)", nullable: false), + RequireMention = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DiscordAlertChannels", x => x.DiscordAlertChannelId); + }); + + migrationBuilder.CreateTable( + name: "DiscordAlertSubscriptions", + columns: table => new + { + DiscordAlertSubscriptionId = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + PageDestination = table.Column(type: "text", nullable: false), + GuildId = table.Column(type: "numeric(20,0)", nullable: false), + PrincipalId = table.Column(type: "numeric(20,0)", nullable: false), + PrincipalType = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DiscordAlertSubscriptions", x => x.DiscordAlertSubscriptionId); + }); + + migrationBuilder.CreateIndex( + name: "IX_DiscordAlertChannels_GuildId", + table: "DiscordAlertChannels", + column: "GuildId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_DiscordAlertSubscriptions_GuildId", + table: "DiscordAlertSubscriptions", + column: "GuildId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DiscordAlertChannels"); + + migrationBuilder.DropTable( + name: "DiscordAlertSubscriptions"); + } + } +} -- cgit v1.3