Finaly DB is deployment ready.
This commit is contained in:
141
EventBot/Migrations/MySql/20190618201842_InitialDatabase.Designer.cs
generated
Normal file
141
EventBot/Migrations/MySql/20190618201842_InitialDatabase.Designer.cs
generated
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using EventBot.Services;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
namespace EventBot.Migrations.MySql
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MySqlDatabaseService))]
|
||||||
|
[Migration("20190618201842_InitialDatabase")]
|
||||||
|
partial class InitialDatabase
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.Event", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<bool>("Active");
|
||||||
|
|
||||||
|
b.Property<string>("Description");
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<ulong>("MessageChannelId");
|
||||||
|
|
||||||
|
b.Property<ulong>("MessageId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Opened");
|
||||||
|
|
||||||
|
b.Property<string>("Title");
|
||||||
|
|
||||||
|
b.Property<int>("Type");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildId");
|
||||||
|
|
||||||
|
b.ToTable("Events");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventParticipant", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("EventId");
|
||||||
|
|
||||||
|
b.Property<int>("EventRoleId");
|
||||||
|
|
||||||
|
b.Property<string>("UserData");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("EventId");
|
||||||
|
|
||||||
|
b.HasIndex("EventRoleId");
|
||||||
|
|
||||||
|
b.ToTable("EventParticipants");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<string>("Description");
|
||||||
|
|
||||||
|
b.Property<string>("Emote");
|
||||||
|
|
||||||
|
b.Property<int>("EventId");
|
||||||
|
|
||||||
|
b.Property<int>("MaxParticipants");
|
||||||
|
|
||||||
|
b.Property<string>("Title");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("EventId");
|
||||||
|
|
||||||
|
b.ToTable("EventRoles");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.GuildConfig", b =>
|
||||||
|
{
|
||||||
|
b.Property<ulong>("GuildId")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("EventRoleConfirmationChannelId");
|
||||||
|
|
||||||
|
b.Property<ulong>("ParticipantRoleId");
|
||||||
|
|
||||||
|
b.Property<string>("Prefix");
|
||||||
|
|
||||||
|
b.HasKey("GuildId");
|
||||||
|
|
||||||
|
b.ToTable("GuildConfigs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.Event", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("EventBot.Entities.GuildConfig", "Guild")
|
||||||
|
.WithMany("Events")
|
||||||
|
.HasForeignKey("GuildId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventParticipant", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("EventBot.Entities.Event", "Event")
|
||||||
|
.WithMany("Participants")
|
||||||
|
.HasForeignKey("EventId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
b.HasOne("EventBot.Entities.EventRole", "Role")
|
||||||
|
.WithMany("Participants")
|
||||||
|
.HasForeignKey("EventRoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventRole", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("EventBot.Entities.Event", "Event")
|
||||||
|
.WithMany("Roles")
|
||||||
|
.HasForeignKey("EventId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
139
EventBot/Migrations/MySql/20190618201842_InitialDatabase.cs
Normal file
139
EventBot/Migrations/MySql/20190618201842_InitialDatabase.cs
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace EventBot.Migrations.MySql
|
||||||
|
{
|
||||||
|
public partial class InitialDatabase : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "GuildConfigs",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
GuildId = table.Column<ulong>(nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Prefix = table.Column<string>(nullable: true),
|
||||||
|
EventRoleConfirmationChannelId = table.Column<ulong>(nullable: false),
|
||||||
|
ParticipantRoleId = table.Column<ulong>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_GuildConfigs", x => x.GuildId);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Events",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Title = table.Column<string>(nullable: true),
|
||||||
|
Description = table.Column<string>(nullable: true),
|
||||||
|
Active = table.Column<bool>(nullable: false),
|
||||||
|
MessageId = table.Column<ulong>(nullable: false),
|
||||||
|
MessageChannelId = table.Column<ulong>(nullable: false),
|
||||||
|
Opened = table.Column<DateTime>(nullable: false),
|
||||||
|
Type = table.Column<int>(nullable: false),
|
||||||
|
GuildId = table.Column<ulong>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Events", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Events_GuildConfigs_GuildId",
|
||||||
|
column: x => x.GuildId,
|
||||||
|
principalTable: "GuildConfigs",
|
||||||
|
principalColumn: "GuildId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "EventRoles",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Title = table.Column<string>(nullable: true),
|
||||||
|
Description = table.Column<string>(nullable: true),
|
||||||
|
Emote = table.Column<string>(nullable: true),
|
||||||
|
MaxParticipants = table.Column<int>(nullable: false),
|
||||||
|
EventId = table.Column<int>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_EventRoles", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EventRoles_Events_EventId",
|
||||||
|
column: x => x.EventId,
|
||||||
|
principalTable: "Events",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "EventParticipants",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
EventRoleId = table.Column<int>(nullable: false),
|
||||||
|
EventId = table.Column<int>(nullable: false),
|
||||||
|
UserId = table.Column<ulong>(nullable: false),
|
||||||
|
UserData = table.Column<string>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_EventParticipants", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EventParticipants_Events_EventId",
|
||||||
|
column: x => x.EventId,
|
||||||
|
principalTable: "Events",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_EventParticipants_EventRoles_EventRoleId",
|
||||||
|
column: x => x.EventRoleId,
|
||||||
|
principalTable: "EventRoles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EventParticipants_EventId",
|
||||||
|
table: "EventParticipants",
|
||||||
|
column: "EventId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EventParticipants_EventRoleId",
|
||||||
|
table: "EventParticipants",
|
||||||
|
column: "EventRoleId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_EventRoles_EventId",
|
||||||
|
table: "EventRoles",
|
||||||
|
column: "EventId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Events_GuildId",
|
||||||
|
table: "Events",
|
||||||
|
column: "GuildId");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "EventParticipants");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "EventRoles");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Events");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "GuildConfigs");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
139
EventBot/Migrations/MySql/MySqlDatabaseServiceModelSnapshot.cs
Normal file
139
EventBot/Migrations/MySql/MySqlDatabaseServiceModelSnapshot.cs
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using EventBot.Services;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
namespace EventBot.Migrations.MySql
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MySqlDatabaseService))]
|
||||||
|
partial class MySqlDatabaseServiceModelSnapshot : ModelSnapshot
|
||||||
|
{
|
||||||
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.Event", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<bool>("Active");
|
||||||
|
|
||||||
|
b.Property<string>("Description");
|
||||||
|
|
||||||
|
b.Property<ulong>("GuildId");
|
||||||
|
|
||||||
|
b.Property<ulong>("MessageChannelId");
|
||||||
|
|
||||||
|
b.Property<ulong>("MessageId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("Opened");
|
||||||
|
|
||||||
|
b.Property<string>("Title");
|
||||||
|
|
||||||
|
b.Property<int>("Type");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("GuildId");
|
||||||
|
|
||||||
|
b.ToTable("Events");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventParticipant", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("EventId");
|
||||||
|
|
||||||
|
b.Property<int>("EventRoleId");
|
||||||
|
|
||||||
|
b.Property<string>("UserData");
|
||||||
|
|
||||||
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("EventId");
|
||||||
|
|
||||||
|
b.HasIndex("EventRoleId");
|
||||||
|
|
||||||
|
b.ToTable("EventParticipants");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<string>("Description");
|
||||||
|
|
||||||
|
b.Property<string>("Emote");
|
||||||
|
|
||||||
|
b.Property<int>("EventId");
|
||||||
|
|
||||||
|
b.Property<int>("MaxParticipants");
|
||||||
|
|
||||||
|
b.Property<string>("Title");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("EventId");
|
||||||
|
|
||||||
|
b.ToTable("EventRoles");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.GuildConfig", b =>
|
||||||
|
{
|
||||||
|
b.Property<ulong>("GuildId")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<ulong>("EventRoleConfirmationChannelId");
|
||||||
|
|
||||||
|
b.Property<ulong>("ParticipantRoleId");
|
||||||
|
|
||||||
|
b.Property<string>("Prefix");
|
||||||
|
|
||||||
|
b.HasKey("GuildId");
|
||||||
|
|
||||||
|
b.ToTable("GuildConfigs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.Event", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("EventBot.Entities.GuildConfig", "Guild")
|
||||||
|
.WithMany("Events")
|
||||||
|
.HasForeignKey("GuildId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventParticipant", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("EventBot.Entities.Event", "Event")
|
||||||
|
.WithMany("Participants")
|
||||||
|
.HasForeignKey("EventId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
b.HasOne("EventBot.Entities.EventRole", "Role")
|
||||||
|
.WithMany("Participants")
|
||||||
|
.HasForeignKey("EventRoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("EventBot.Entities.EventRole", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("EventBot.Entities.Event", "Event")
|
||||||
|
.WithMany("Roles")
|
||||||
|
.HasForeignKey("EventId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -8,7 +8,6 @@ using System.Threading.Tasks;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EventBot.Entities;
|
using EventBot.Entities;
|
||||||
using Discord.WebSocket;
|
using Discord.WebSocket;
|
||||||
using NeoSmart.Unicode;
|
|
||||||
using Discord.Addons.Interactive;
|
using Discord.Addons.Interactive;
|
||||||
|
|
||||||
namespace EventBot.Modules
|
namespace EventBot.Modules
|
||||||
|
Reference in New Issue
Block a user