diff options
| author | Jake Mannens <jake@asger.xyz> | 2024-09-20 16:21:09 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2024-10-29 11:42:54 +1100 |
| commit | e8e3c4cba8ffa0056e984c113cfbb75319e00022 (patch) | |
| tree | 8336315e61f9e77207276d478b25fe5dc7c3d06c /Migrations/20241011050136_v0.4-rc1.cs | |
| parent | 0e21907c76dbefed11f382bcf949143f0716567f (diff) | |
v0.4-rc1v0.4-rc1
Diffstat (limited to 'Migrations/20241011050136_v0.4-rc1.cs')
| -rw-r--r-- | Migrations/20241011050136_v0.4-rc1.cs | 67 |
1 files changed, 67 insertions, 0 deletions
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 +{ + /// <inheritdoc /> + public partial class v04rc1 : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "DiscordAlertChannels", + columns: table => new + { + DiscordAlertChannelId = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + GuildId = table.Column<decimal>(type: "numeric(20,0)", nullable: false), + ChannelId = table.Column<decimal>(type: "numeric(20,0)", nullable: false), + RequireMention = table.Column<bool>(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DiscordAlertChannels", x => x.DiscordAlertChannelId); + }); + + migrationBuilder.CreateTable( + name: "DiscordAlertSubscriptions", + columns: table => new + { + DiscordAlertSubscriptionId = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + PageDestination = table.Column<string>(type: "text", nullable: false), + GuildId = table.Column<decimal>(type: "numeric(20,0)", nullable: false), + PrincipalId = table.Column<decimal>(type: "numeric(20,0)", nullable: false), + PrincipalType = table.Column<int>(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"); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DiscordAlertChannels"); + + migrationBuilder.DropTable( + name: "DiscordAlertSubscriptions"); + } + } +} |
