NadekoBot Patronage system, Search commands improvements + fixes

This commit is contained in:
Kwoth
2022-06-14 07:24:33 +00:00
parent 18b10b8c6f
commit 7b5145f116
165 changed files with 14920 additions and 1457 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,170 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NadekoBot.Migrations.PostgreSql
{
public partial class patronagesystem : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "patreonuserid",
table: "rewardedusers",
newName: "platformuserid");
migrationBuilder.RenameIndex(
name: "ix_rewardedusers_patreonuserid",
table: "rewardedusers",
newName: "ix_rewardedusers_platformuserid");
migrationBuilder.AlterColumn<long>(
name: "xp",
table: "userxpstats",
type: "bigint",
nullable: false,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<long>(
name: "awardedxp",
table: "userxpstats",
type: "bigint",
nullable: false,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<long>(
name: "amountrewardedthismonth",
table: "rewardedusers",
type: "bigint",
nullable: false,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<bool>(
name: "verboseerrors",
table: "guildconfigs",
type: "boolean",
nullable: false,
defaultValue: true,
oldClrType: typeof(bool),
oldType: "boolean");
migrationBuilder.AlterColumn<long>(
name: "totalxp",
table: "discorduser",
type: "bigint",
nullable: false,
defaultValue: 0L,
oldClrType: typeof(int),
oldType: "integer",
oldDefaultValue: 0);
migrationBuilder.CreateTable(
name: "patronquotas",
columns: table => new
{
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
featuretype = table.Column<int>(type: "integer", nullable: false),
feature = table.Column<string>(type: "text", nullable: false),
hourlycount = table.Column<long>(type: "bigint", nullable: false),
dailycount = table.Column<long>(type: "bigint", nullable: false),
monthlycount = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_patronquotas", x => new { x.userid, x.featuretype, x.feature });
});
migrationBuilder.CreateTable(
name: "patrons",
columns: table => new
{
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
uniqueplatformuserid = table.Column<string>(type: "text", nullable: true),
amountcents = table.Column<int>(type: "integer", nullable: false),
lastcharge = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
validthru = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_patrons", x => x.userid);
});
migrationBuilder.CreateIndex(
name: "ix_patronquotas_userid",
table: "patronquotas",
column: "userid");
migrationBuilder.CreateIndex(
name: "ix_patrons_uniqueplatformuserid",
table: "patrons",
column: "uniqueplatformuserid",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "patronquotas");
migrationBuilder.DropTable(
name: "patrons");
migrationBuilder.RenameColumn(
name: "platformuserid",
table: "rewardedusers",
newName: "patreonuserid");
migrationBuilder.RenameIndex(
name: "ix_rewardedusers_platformuserid",
table: "rewardedusers",
newName: "ix_rewardedusers_patreonuserid");
migrationBuilder.AlterColumn<int>(
name: "xp",
table: "userxpstats",
type: "integer",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AlterColumn<int>(
name: "awardedxp",
table: "userxpstats",
type: "integer",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AlterColumn<int>(
name: "amountrewardedthismonth",
table: "rewardedusers",
type: "integer",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AlterColumn<bool>(
name: "verboseerrors",
table: "guildconfigs",
type: "boolean",
nullable: false,
oldClrType: typeof(bool),
oldType: "boolean",
oldDefaultValue: true);
migrationBuilder.AlterColumn<int>(
name: "totalxp",
table: "discorduser",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(long),
oldType: "bigint",
oldDefaultValue: 0L);
}
}
}

View File

@@ -17,7 +17,7 @@ namespace NadekoBot.Migrations.PostgreSql
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.4")
.HasAnnotation("ProductVersion", "6.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@@ -194,10 +194,10 @@ namespace NadekoBot.Migrations.PostgreSql
.HasDefaultValue(0)
.HasColumnName("notifyonlevelup");
b.Property<int>("TotalXp")
b.Property<long>("TotalXp")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(0)
.HasColumnType("bigint")
.HasDefaultValue(0L)
.HasColumnName("totalxp");
b.Property<decimal>("UserId")
@@ -275,6 +275,74 @@ namespace NadekoBot.Migrations.PostgreSql
b.ToTable("followedstream", (string)null);
});
modelBuilder.Entity("NadekoBot.Db.Models.PatronQuota", b =>
{
b.Property<decimal>("UserId")
.HasColumnType("numeric(20,0)")
.HasColumnName("userid");
b.Property<int>("FeatureType")
.HasColumnType("integer")
.HasColumnName("featuretype");
b.Property<string>("Feature")
.HasColumnType("text")
.HasColumnName("feature");
b.Property<long>("DailyCount")
.HasColumnType("bigint")
.HasColumnName("dailycount");
b.Property<long>("HourlyCount")
.HasColumnType("bigint")
.HasColumnName("hourlycount");
b.Property<long>("MonthlyCount")
.HasColumnType("bigint")
.HasColumnName("monthlycount");
b.HasKey("UserId", "FeatureType", "Feature")
.HasName("pk_patronquotas");
b.HasIndex("UserId")
.HasDatabaseName("ix_patronquotas_userid");
b.ToTable("patronquotas", (string)null);
});
modelBuilder.Entity("NadekoBot.Db.Models.PatronUser", b =>
{
b.Property<decimal>("UserId")
.ValueGeneratedOnAdd()
.HasColumnType("numeric(20,0)")
.HasColumnName("userid");
b.Property<int>("AmountCents")
.HasColumnType("integer")
.HasColumnName("amountcents");
b.Property<DateTime>("LastCharge")
.HasColumnType("timestamp with time zone")
.HasColumnName("lastcharge");
b.Property<string>("UniquePlatformUserId")
.HasColumnType("text")
.HasColumnName("uniqueplatformuserid");
b.Property<DateTime>("ValidThru")
.HasColumnType("timestamp with time zone")
.HasColumnName("validthru");
b.HasKey("UserId")
.HasName("pk_patrons");
b.HasIndex("UniquePlatformUserId")
.IsUnique()
.HasDatabaseName("ix_patrons_uniqueplatformuserid");
b.ToTable("patrons", (string)null);
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiAltSetting", b =>
{
b.Property<int>("Id")
@@ -1194,7 +1262,9 @@ namespace NadekoBot.Migrations.PostgreSql
.HasColumnName("timezoneid");
b.Property<bool>("VerboseErrors")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(true)
.HasColumnName("verboseerrors");
b.Property<bool>("VerbosePermissions")
@@ -2058,8 +2128,8 @@ namespace NadekoBot.Migrations.PostgreSql
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AmountRewardedThisMonth")
.HasColumnType("integer")
b.Property<long>("AmountRewardedThisMonth")
.HasColumnType("bigint")
.HasColumnName("amountrewardedthismonth");
b.Property<DateTime?>("DateAdded")
@@ -2070,9 +2140,9 @@ namespace NadekoBot.Migrations.PostgreSql
.HasColumnType("timestamp with time zone")
.HasColumnName("lastreward");
b.Property<string>("PatreonUserId")
b.Property<string>("PlatformUserId")
.HasColumnType("text")
.HasColumnName("patreonuserid");
.HasColumnName("platformuserid");
b.Property<decimal>("UserId")
.HasColumnType("numeric(20,0)")
@@ -2081,9 +2151,9 @@ namespace NadekoBot.Migrations.PostgreSql
b.HasKey("Id")
.HasName("pk_rewardedusers");
b.HasIndex("PatreonUserId")
b.HasIndex("PlatformUserId")
.IsUnique()
.HasDatabaseName("ix_rewardedusers_patreonuserid");
.HasDatabaseName("ix_rewardedusers_platformuserid");
b.ToTable("rewardedusers", (string)null);
});
@@ -2526,8 +2596,8 @@ namespace NadekoBot.Migrations.PostgreSql
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AwardedXp")
.HasColumnType("integer")
b.Property<long>("AwardedXp")
.HasColumnType("bigint")
.HasColumnName("awardedxp");
b.Property<DateTime?>("DateAdded")
@@ -2552,8 +2622,8 @@ namespace NadekoBot.Migrations.PostgreSql
.HasColumnType("numeric(20,0)")
.HasColumnName("userid");
b.Property<int>("Xp")
.HasColumnType("integer")
b.Property<long>("Xp")
.HasColumnType("bigint")
.HasColumnName("xp");
b.HasKey("Id")