From fdc6967bd0a7022387980abe6eefe33a7db7dbd3 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 1 Sep 2016 02:19:29 +0200 Subject: [PATCH] Updated migration --- ...er.cs => 20160901001820_first.Designer.cs} | 35 +++++++++++++++++- ...11641_first.cs => 20160901001820_first.cs} | 37 ++++++++++++++++++- .../NadekoSqliteContextModelSnapshot.cs | 33 +++++++++++++++++ 3 files changed, 102 insertions(+), 3 deletions(-) rename src/NadekoBot/Migrations/{20160830011641_first.Designer.cs => 20160901001820_first.Designer.cs} (91%) rename src/NadekoBot/Migrations/{20160830011641_first.cs => 20160901001820_first.cs} (91%) diff --git a/src/NadekoBot/Migrations/20160830011641_first.Designer.cs b/src/NadekoBot/Migrations/20160901001820_first.Designer.cs similarity index 91% rename from src/NadekoBot/Migrations/20160830011641_first.Designer.cs rename to src/NadekoBot/Migrations/20160901001820_first.Designer.cs index a1c78a53..dd86f1dc 100644 --- a/src/NadekoBot/Migrations/20160830011641_first.Designer.cs +++ b/src/NadekoBot/Migrations/20160901001820_first.Designer.cs @@ -8,7 +8,7 @@ using NadekoBot.Services.Database.Impl; namespace NadekoBot.Migrations { [DbContext(typeof(NadekoSqliteContext))] - [Migration("20160830011641_first")] + [Migration("20160901001820_first")] partial class first { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -156,6 +156,30 @@ namespace NadekoBot.Migrations b.ToTable("EightBallResponse"); }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ChannelId"); + + b.Property("GuildConfigId"); + + b.Property("GuildId"); + + b.Property("LastStatus"); + + b.Property("Type"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FollowedStream"); + }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b => { b.Property("Id") @@ -195,6 +219,8 @@ namespace NadekoBot.Migrations b.Property("SendDmGreetMessage"); + b.Property("VoicePlusTextEnabled"); + b.HasKey("Id"); b.HasIndex("GuildId") @@ -360,6 +386,13 @@ namespace NadekoBot.Migrations .HasForeignKey("BotConfigId"); }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.FollowedStream", b => + { + b.HasOne("NadekoBot.Services.Database.Models.GuildConfig") + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId"); + }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b => { b.HasOne("NadekoBot.Services.Database.Models.BotConfig") diff --git a/src/NadekoBot/Migrations/20160830011641_first.cs b/src/NadekoBot/Migrations/20160901001820_first.cs similarity index 91% rename from src/NadekoBot/Migrations/20160830011641_first.cs rename to src/NadekoBot/Migrations/20160901001820_first.cs index cf8464d4..b1d5d6b5 100644 --- a/src/NadekoBot/Migrations/20160830011641_first.cs +++ b/src/NadekoBot/Migrations/20160901001820_first.cs @@ -98,7 +98,8 @@ namespace NadekoBot.Migrations GuildId = table.Column(nullable: false), SendChannelByeMessage = table.Column(nullable: false), SendChannelGreetMessage = table.Column(nullable: false), - SendDmGreetMessage = table.Column(nullable: false) + SendDmGreetMessage = table.Column(nullable: false), + VoicePlusTextEnabled = table.Column(nullable: false) }, constraints: table => { @@ -295,6 +296,30 @@ namespace NadekoBot.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "FollowedStream", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Autoincrement", true), + ChannelId = table.Column(nullable: false), + GuildConfigId = table.Column(nullable: true), + GuildId = table.Column(nullable: false), + LastStatus = table.Column(nullable: false), + Type = table.Column(nullable: false), + Username = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_FollowedStream", x => x.Id); + table.ForeignKey( + name: "FK_FollowedStream_GuildConfigs_GuildConfigId", + column: x => x.GuildConfigId, + principalTable: "GuildConfigs", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateIndex( name: "IX_BlacklistItem_BotConfigId", table: "BlacklistItem", @@ -322,6 +347,11 @@ namespace NadekoBot.Migrations table: "EightBallResponse", column: "BotConfigId"); + migrationBuilder.CreateIndex( + name: "IX_FollowedStream_GuildConfigId", + table: "FollowedStream", + column: "GuildConfigId"); + migrationBuilder.CreateIndex( name: "IX_GuildConfigs_GuildId", table: "GuildConfigs", @@ -374,7 +404,7 @@ namespace NadekoBot.Migrations name: "EightBallResponse"); migrationBuilder.DropTable( - name: "GuildConfigs"); + name: "FollowedStream"); migrationBuilder.DropTable( name: "ModulePrefix"); @@ -400,6 +430,9 @@ namespace NadekoBot.Migrations migrationBuilder.DropTable( name: "ClashOfClans"); + migrationBuilder.DropTable( + name: "GuildConfigs"); + migrationBuilder.DropTable( name: "BotConfig"); } diff --git a/src/NadekoBot/Migrations/NadekoSqliteContextModelSnapshot.cs b/src/NadekoBot/Migrations/NadekoSqliteContextModelSnapshot.cs index 456411fc..af288187 100644 --- a/src/NadekoBot/Migrations/NadekoSqliteContextModelSnapshot.cs +++ b/src/NadekoBot/Migrations/NadekoSqliteContextModelSnapshot.cs @@ -155,6 +155,30 @@ namespace NadekoBot.Migrations b.ToTable("EightBallResponse"); }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ChannelId"); + + b.Property("GuildConfigId"); + + b.Property("GuildId"); + + b.Property("LastStatus"); + + b.Property("Type"); + + b.Property("Username"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FollowedStream"); + }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b => { b.Property("Id") @@ -194,6 +218,8 @@ namespace NadekoBot.Migrations b.Property("SendDmGreetMessage"); + b.Property("VoicePlusTextEnabled"); + b.HasKey("Id"); b.HasIndex("GuildId") @@ -359,6 +385,13 @@ namespace NadekoBot.Migrations .HasForeignKey("BotConfigId"); }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.FollowedStream", b => + { + b.HasOne("NadekoBot.Services.Database.Models.GuildConfig") + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId"); + }); + modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b => { b.HasOne("NadekoBot.Services.Database.Models.BotConfig")