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:
3904
src/NadekoBot/Migrations/Postgresql/20240424152951_giveaway.Designer.cs
generated
Normal file
3904
src/NadekoBot/Migrations/Postgresql/20240424152951_giveaway.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace NadekoBot.Db.Migrations
|
||||
{
|
||||
/// <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("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
messageid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
message = table.Column<string>(type: "text", nullable: false),
|
||||
endsat = table.Column<DateTime>(type: "timestamp without time zone", 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("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
giveawayid = table.Column<int>(type: "integer", nullable: false),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", 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");
|
||||
}
|
||||
}
|
||||
}
|
@@ -3072,6 +3072,70 @@ namespace NadekoBot.Db.Migrations
|
||||
b.ToTable("followedstream", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime>("EndsAt")
|
||||
.HasColumnType("timestamp without time zone")
|
||||
.HasColumnName("endsat");
|
||||
|
||||
b.Property<decimal>("GuildId")
|
||||
.HasColumnType("numeric(20,0)")
|
||||
.HasColumnName("guildid");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("message");
|
||||
|
||||
b.Property<decimal>("MessageId")
|
||||
.HasColumnType("numeric(20,0)")
|
||||
.HasColumnName("messageid");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_giveawaymodel");
|
||||
|
||||
b.ToTable("giveawaymodel", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayUser", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GiveawayId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("giveawayid");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<decimal>("UserId")
|
||||
.HasColumnType("numeric(20,0)")
|
||||
.HasColumnName("userid");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_giveawayuser");
|
||||
|
||||
b.HasIndex("GiveawayId", "UserId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_giveawayuser_giveawayid_userid");
|
||||
|
||||
b.ToTable("giveawayuser", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.PatronQuota", b =>
|
||||
{
|
||||
b.Property<decimal>("UserId")
|
||||
@@ -3700,6 +3764,16 @@ namespace NadekoBot.Db.Migrations
|
||||
.HasConstraintName("fk_followedstream_guildconfigs_guildconfigid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("NadekoBot.Db.Models.GiveawayUser", b =>
|
||||
{
|
||||
b.HasOne("NadekoBot.Db.Models.GiveawayModel", null)
|
||||
.WithMany("Participants")
|
||||
.HasForeignKey("GiveawayId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Nadeko.Bot.Db.Models.AntiSpamSetting", b =>
|
||||
{
|
||||
b.Navigation("IgnoredChannels");
|
||||
@@ -3816,6 +3890,11 @@ namespace NadekoBot.Db.Migrations
|
||||
|
||||
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