Forgot migrations

This commit is contained in:
Kwoth 2016-08-25 15:19:28 +02:00
parent 4871f79ad8
commit c91716a143
3 changed files with 117 additions and 62 deletions

View File

@ -8,7 +8,7 @@ using NadekoBot.Services.Database.Impl;
namespace NadekoBot.Migrations namespace NadekoBot.Migrations
{ {
[DbContext(typeof(NadekoSqliteContext))] [DbContext(typeof(NadekoSqliteContext))]
[Migration("20160824232035_FirstMigration")] [Migration("20160825131849_FirstMigration")]
partial class FirstMigration partial class FirstMigration
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -16,25 +16,6 @@ namespace NadekoBot.Migrations
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431"); .HasAnnotation("ProductVersion", "1.0.0-rtm-21431");
modelBuilder.Entity("NadekoBot.Services.Database.Models.Config", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<ulong>("AutoAssignRoleId");
b.Property<bool>("DeleteMessageOnCommand");
b.Property<ulong>("GuildId");
b.HasKey("Id");
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("GuildConfigs");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Donator", b => modelBuilder.Entity("NadekoBot.Services.Database.Models.Donator", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -54,6 +35,47 @@ namespace NadekoBot.Migrations
b.ToTable("Donators"); b.ToTable("Donators");
}); });
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<ulong>("AutoAssignRoleId");
b.Property<bool>("AutoDeleteByeMessages");
b.Property<bool>("AutoDeleteGreetMessages");
b.Property<int>("AutoDeleteGreetMessagesTimer");
b.Property<ulong>("ByeMessageChannelId");
b.Property<string>("ChannelByeMessageText");
b.Property<string>("ChannelGreetMessageText");
b.Property<bool>("DeleteMessageOnCommand");
b.Property<string>("DmGreetMessageText");
b.Property<ulong>("GreetMessageChannelId");
b.Property<ulong>("GuildId");
b.Property<bool>("SendChannelByeMessage");
b.Property<bool>("SendChannelGreetMessage");
b.Property<bool>("SendDmGreetMessage");
b.HasKey("Id");
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("GuildConfigs");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Quote", b => modelBuilder.Entity("NadekoBot.Services.Database.Models.Quote", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")

View File

@ -8,21 +8,6 @@ namespace NadekoBot.Migrations
{ {
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.CreateTable(
name: "GuildConfigs",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Autoincrement", true),
AutoAssignRoleId = table.Column<ulong>(nullable: false),
DeleteMessageOnCommand = table.Column<bool>(nullable: false),
GuildId = table.Column<ulong>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GuildConfigs", x => x.Id);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Donators", name: "Donators",
columns: table => new columns: table => new
@ -38,6 +23,32 @@ namespace NadekoBot.Migrations
table.PrimaryKey("PK_Donators", x => x.Id); table.PrimaryKey("PK_Donators", x => x.Id);
}); });
migrationBuilder.CreateTable(
name: "GuildConfigs",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Autoincrement", true),
AutoAssignRoleId = table.Column<ulong>(nullable: false),
AutoDeleteByeMessages = table.Column<bool>(nullable: false),
AutoDeleteGreetMessages = table.Column<bool>(nullable: false),
AutoDeleteGreetMessagesTimer = table.Column<int>(nullable: false),
ByeMessageChannelId = table.Column<ulong>(nullable: false),
ChannelByeMessageText = table.Column<string>(nullable: true),
ChannelGreetMessageText = table.Column<string>(nullable: true),
DeleteMessageOnCommand = table.Column<bool>(nullable: false),
DmGreetMessageText = table.Column<string>(nullable: true),
GreetMessageChannelId = table.Column<ulong>(nullable: false),
GuildId = table.Column<ulong>(nullable: false),
SendChannelByeMessage = table.Column<bool>(nullable: false),
SendChannelGreetMessage = table.Column<bool>(nullable: false),
SendDmGreetMessage = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GuildConfigs", x => x.Id);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Quotes", name: "Quotes",
columns: table => new columns: table => new
@ -55,26 +66,26 @@ namespace NadekoBot.Migrations
table.PrimaryKey("PK_Quotes", x => x.Id); table.PrimaryKey("PK_Quotes", x => x.Id);
}); });
migrationBuilder.CreateIndex(
name: "IX_GuildConfigs_GuildId",
table: "GuildConfigs",
column: "GuildId",
unique: true);
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Donators_UserId", name: "IX_Donators_UserId",
table: "Donators", table: "Donators",
column: "UserId", column: "UserId",
unique: true); unique: true);
migrationBuilder.CreateIndex(
name: "IX_GuildConfigs_GuildId",
table: "GuildConfigs",
column: "GuildId",
unique: true);
} }
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "GuildConfigs"); name: "Donators");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Donators"); name: "GuildConfigs");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Quotes"); name: "Quotes");

View File

@ -15,25 +15,6 @@ namespace NadekoBot.Migrations
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431"); .HasAnnotation("ProductVersion", "1.0.0-rtm-21431");
modelBuilder.Entity("NadekoBot.Services.Database.Models.Config", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<ulong>("AutoAssignRoleId");
b.Property<bool>("DeleteMessageOnCommand");
b.Property<ulong>("GuildId");
b.HasKey("Id");
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("GuildConfigs");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Donator", b => modelBuilder.Entity("NadekoBot.Services.Database.Models.Donator", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -53,6 +34,47 @@ namespace NadekoBot.Migrations
b.ToTable("Donators"); b.ToTable("Donators");
}); });
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<ulong>("AutoAssignRoleId");
b.Property<bool>("AutoDeleteByeMessages");
b.Property<bool>("AutoDeleteGreetMessages");
b.Property<int>("AutoDeleteGreetMessagesTimer");
b.Property<ulong>("ByeMessageChannelId");
b.Property<string>("ChannelByeMessageText");
b.Property<string>("ChannelGreetMessageText");
b.Property<bool>("DeleteMessageOnCommand");
b.Property<string>("DmGreetMessageText");
b.Property<ulong>("GreetMessageChannelId");
b.Property<ulong>("GuildId");
b.Property<bool>("SendChannelByeMessage");
b.Property<bool>("SendChannelGreetMessage");
b.Property<bool>("SendDmGreetMessage");
b.HasKey("Id");
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("GuildConfigs");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Quote", b => modelBuilder.Entity("NadekoBot.Services.Database.Models.Quote", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")