Compare commits

..

No commits in common. "ed7deeb99dfb1049d1da30389e75aedff802095b" and "a63889b2f3675e15e903865b41120dc372da7f32" have entirely different histories.

50 changed files with 175 additions and 10655 deletions

View file

@ -53,6 +53,8 @@ public abstract class EllieContext : DbContext
public DbSet<PatronUser> Patrons { get; set; } public DbSet<PatronUser> Patrons { get; set; }
public DbSet<PatronQuota> PatronQuotas { get; set; }
public DbSet<StreamOnlineMessage> StreamOnlineMessages { get; set; } public DbSet<StreamOnlineMessage> StreamOnlineMessages { get; set; }
public DbSet<StickyRole> StickyRoles { get; set; } public DbSet<StickyRole> StickyRoles { get; set; }
@ -595,6 +597,16 @@ public abstract class EllieContext : DbContext
}); });
// quotes are per user id // quotes are per user id
modelBuilder.Entity<PatronQuota>(pq =>
{
pq.HasIndex(x => x.UserId).IsUnique(false);
pq.HasKey(x => new
{
x.UserId,
x.FeatureType,
x.Feature
});
});
#endregion #endregion

View file

@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace EllieBot.Db.Models; namespace EllieBot.Db.Models;
public class AntiRaidSetting : DbEntity public class AntiRaidSetting : DbEntity
{ {
public int GuildConfigId { get; set; } public int GuildConfigId { get; set; }

View file

@ -1,17 +1,41 @@
#nullable disable #nullable disable
namespace EllieBot.Db.Models; namespace EllieBot.Db.Models;
/// <summary>
/// Contains data about usage of Patron-Only commands per user
/// in order to provide support for quota limitations
/// (allow user x who is pledging amount y to use the specified command only
/// x amount of times in the specified time period)
/// </summary>
public class PatronQuota
{
public ulong UserId { get; set; }
public FeatureType FeatureType { get; set; }
public string Feature { get; set; }
public uint HourlyCount { get; set; }
public uint DailyCount { get; set; }
public uint MonthlyCount { get; set; }
}
public enum FeatureType
{
Command,
Group,
Module,
Limit
}
public class PatronUser public class PatronUser
{ {
public string UniquePlatformUserId { get; set; } public string UniquePlatformUserId { get; set; }
public ulong UserId { get; set; } public ulong UserId { get; set; }
public int AmountCents { get; set; } public int AmountCents { get; set; }
public DateTime LastCharge { get; set; } public DateTime LastCharge { get; set; }
// Date Only component // Date Only component
public DateTime ValidThru { get; set; } public DateTime ValidThru { get; set; }
public PatronUser Clone() public PatronUser Clone()
=> new PatronUser() => new PatronUser()
{ {

View file

@ -1418,7 +1418,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1422,7 +1422,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1451,7 +1451,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1451,7 +1451,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1521,7 +1521,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1554,7 +1554,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1558,7 +1558,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1596,7 +1596,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1600,7 +1600,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1588,7 +1588,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1592,7 +1592,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1592,7 +1592,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1621,7 +1621,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1654,7 +1654,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1658,7 +1658,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1666,7 +1666,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1670,7 +1670,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1700,7 +1700,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1670,7 +1670,7 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

File diff suppressed because it is too large Load diff

View file

@ -1,44 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EllieBot.Migrations.Mysql
{
/// <inheritdoc />
public partial class removepatronlimits : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "patronquotas");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "patronquotas",
columns: table => new
{
userid = table.Column<ulong>(type: "bigint unsigned", nullable: false),
featuretype = table.Column<int>(type: "int", nullable: false),
feature = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
dailycount = table.Column<uint>(type: "int unsigned", nullable: false),
hourlycount = table.Column<uint>(type: "int unsigned", nullable: false),
monthlycount = table.Column<uint>(type: "int unsigned", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_patronquotas", x => new { x.userid, x.featuretype, x.feature });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "ix_patronquotas_userid",
table: "patronquotas",
column: "userid");
}
}
}

View file

@ -1718,6 +1718,41 @@ namespace EllieBot.Migrations.Mysql
b.ToTable("expressions", (string)null); b.ToTable("expressions", (string)null);
}); });
modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b =>
{
b.Property<ulong>("UserId")
.HasColumnType("bigint unsigned")
.HasColumnName("userid");
b.Property<int>("FeatureType")
.HasColumnType("int")
.HasColumnName("featuretype");
b.Property<string>("Feature")
.HasColumnType("varchar(255)")
.HasColumnName("feature");
b.Property<uint>("DailyCount")
.HasColumnType("int unsigned")
.HasColumnName("dailycount");
b.Property<uint>("HourlyCount")
.HasColumnType("int unsigned")
.HasColumnName("hourlycount");
b.Property<uint>("MonthlyCount")
.HasColumnType("int unsigned")
.HasColumnName("monthlycount");
b.HasKey("UserId", "FeatureType", "Feature")
.HasName("pk_patronquotas");
b.HasIndex("UserId")
.HasDatabaseName("ix_patronquotas_userid");
b.ToTable("patronquotas", (string)null);
});
modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b =>
{ {
b.Property<ulong>("UserId") b.Property<ulong>("UserId")

View file

@ -1490,7 +1490,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1521,7 +1521,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1521,7 +1521,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1591,7 +1591,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1626,7 +1626,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1630,7 +1630,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1670,7 +1670,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1674,7 +1674,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1662,7 +1662,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1666,7 +1666,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1666,7 +1666,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1697,7 +1697,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1732,7 +1732,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1736,7 +1736,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1744,7 +1744,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1748,7 +1748,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1699,7 +1699,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1669,7 +1669,7 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("muteduserid", (string)null); b.ToTable("muteduserid", (string)null);
}); });
modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()

View file

@ -1,42 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EllieBot.Migrations.PostgreSql
{
/// <inheritdoc />
public partial class removepatronlimits : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "patronquotas");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
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),
dailycount = table.Column<long>(type: "bigint", nullable: false),
hourlycount = 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.CreateIndex(
name: "ix_patronquotas_userid",
table: "patronquotas",
column: "userid");
}
}
}

View file

@ -1717,6 +1717,41 @@ namespace EllieBot.Migrations.PostgreSql
b.ToTable("expressions", (string)null); b.ToTable("expressions", (string)null);
}); });
modelBuilder.Entity("EllieBot.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("EllieBot.Db.Models.PatronUser", b => modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b =>
{ {
b.Property<decimal>("UserId") b.Property<decimal>("UserId")

View file

@ -12,7 +12,7 @@ namespace EllieBot.Migrations
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
MigrationQueries.GuildConfigCleanup(migrationBuilder); MigrationQueries.GuildConfigCleanup(migrationBuilder);
migrationBuilder.DropForeignKey( migrationBuilder.DropForeignKey(
name: "FK_AntiRaidSetting_GuildConfigs_GuildConfigId", name: "FK_AntiRaidSetting_GuildConfigs_GuildConfigId",
table: "AntiRaidSetting"); table: "AntiRaidSetting");

File diff suppressed because it is too large Load diff

View file

@ -1,42 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EllieBot.Migrations
{
/// <inheritdoc />
public partial class removepatronlimits : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PatronQuotas");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PatronQuotas",
columns: table => new
{
UserId = table.Column<ulong>(type: "INTEGER", nullable: false),
FeatureType = table.Column<int>(type: "INTEGER", nullable: false),
Feature = table.Column<string>(type: "TEXT", nullable: false),
DailyCount = table.Column<uint>(type: "INTEGER", nullable: false),
HourlyCount = table.Column<uint>(type: "INTEGER", nullable: false),
MonthlyCount = table.Column<uint>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PatronQuotas", x => new { x.UserId, x.FeatureType, x.Feature });
});
migrationBuilder.CreateIndex(
name: "IX_PatronQuotas_UserId",
table: "PatronQuotas",
column: "UserId");
}
}
}

View file

@ -1279,6 +1279,33 @@ namespace EllieBot.Migrations
b.ToTable("Expressions"); b.ToTable("Expressions");
}); });
modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b =>
{
b.Property<ulong>("UserId")
.HasColumnType("INTEGER");
b.Property<int>("FeatureType")
.HasColumnType("INTEGER");
b.Property<string>("Feature")
.HasColumnType("TEXT");
b.Property<uint>("DailyCount")
.HasColumnType("INTEGER");
b.Property<uint>("HourlyCount")
.HasColumnType("INTEGER");
b.Property<uint>("MonthlyCount")
.HasColumnType("INTEGER");
b.HasKey("UserId", "FeatureType", "Feature");
b.HasIndex("UserId");
b.ToTable("PatronQuotas");
});
modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b =>
{ {
b.Property<ulong>("UserId") b.Property<ulong>("UserId")