mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Started work on giveaways, not completed
This commit is contained in:
3009
src/NadekoBot/Migrations/Sqlite/20240424152943_giveaway.Designer.cs
generated
Normal file
3009
src/NadekoBot/Migrations/Sqlite/20240424152943_giveaway.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
68
src/NadekoBot/Migrations/Sqlite/20240424152943_giveaway.cs
Normal file
68
src/NadekoBot/Migrations/Sqlite/20240424152943_giveaway.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace NadekoBot.Db.Migrations.Sqlite
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class giveaway : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GiveawayModel",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GuildId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
MessageId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
Message = table.Column<string>(type: "TEXT", nullable: false),
|
||||
EndsAt = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GiveawayModel", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GiveawayUser",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GiveawayId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
UserId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GiveawayUser", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GiveawayUser_GiveawayModel_GiveawayId",
|
||||
column: x => x.GiveawayId,
|
||||
principalTable: "GiveawayModel",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiveawayUser_GiveawayId_UserId",
|
||||
table: "GiveawayUser",
|
||||
columns: new[] { "GiveawayId", "UserId" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GiveawayUser");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GiveawayModel");
|
||||
}
|
||||
}
|
||||
}
|
@@ -2280,6 +2280,54 @@ namespace NadekoBot.Db.Migrations.Sqlite
|
||||
b.ToTable("FollowedStream");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("EndsAt")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<ulong>("GuildId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<ulong>("MessageId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("GiveawayModel");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayUser", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GiveawayId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<ulong>("UserId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GiveawayId", "UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GiveawayUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.PatronQuota", b =>
|
||||
{
|
||||
b.Property<ulong>("UserId")
|
||||
@@ -2822,6 +2870,15 @@ namespace NadekoBot.Db.Migrations.Sqlite
|
||||
.HasForeignKey("GuildConfigId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayUser", b =>
|
||||
{
|
||||
b.HasOne("NadekoBot.Db.Models.GiveawayModel", null)
|
||||
.WithMany("Participants")
|
||||
.HasForeignKey("GiveawayId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Nadeko.Bot.Db.Models.AntiSpamSetting", b =>
|
||||
{
|
||||
b.Navigation("IgnoredChannels");
|
||||
@@ -2938,6 +2995,11 @@ namespace NadekoBot.Db.Migrations.Sqlite
|
||||
|
||||
b.Navigation("Members");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayModel", b =>
|
||||
{
|
||||
b.Navigation("Participants");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user