diff options
| author | Michael <[email protected]> | 2017-03-20 16:45:17 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-20 16:45:17 -0400 |
| commit | cdc61eb4ea5309769ad4db84d92594e4dc3dff67 (patch) | |
| tree | a8297a7aecc4376f07a497a5e02ab5ff165bfbd3 /Project-Unite/Migrations/201703161536324_morerelationfix.cs | |
| parent | d9f475e1f33bbf39ca0d79d7a6b0c2fd501b4f2d (diff) | |
| download | project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.gz project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.bz2 project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.zip | |
Initial commit (azure deploy test)
Diffstat (limited to 'Project-Unite/Migrations/201703161536324_morerelationfix.cs')
| -rw-r--r-- | Project-Unite/Migrations/201703161536324_morerelationfix.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Project-Unite/Migrations/201703161536324_morerelationfix.cs b/Project-Unite/Migrations/201703161536324_morerelationfix.cs new file mode 100644 index 0000000..611be32 --- /dev/null +++ b/Project-Unite/Migrations/201703161536324_morerelationfix.cs @@ -0,0 +1,54 @@ +namespace Project_Unite.Migrations +{ + using System; + using System.Data.Entity.Migrations; + + public partial class morerelationfix : DbMigration + { + public override void Up() + { + RenameColumn(table: "dbo.ForumCategories", name: "ForumCategory_Id", newName: "Parent_Id"); + RenameColumn(table: "dbo.ACLForumPermissions", name: "ForumCategory_Id", newName: "Parent_Id"); + RenameColumn(table: "dbo.ForumTopics", name: "ForumCategory_Id", newName: "Parent_Id"); + RenameColumn(table: "dbo.ForumPosts", name: "ForumTopic_Id", newName: "Parent_Id"); + RenameColumn(table: "dbo.ForumPostEdits", name: "ForumPost_Id", newName: "Parent_Id"); + RenameColumn(table: "dbo.Likes", name: "ForumPost_Id", newName: "Post_Id"); + RenameColumn(table: "dbo.ForumPollVotes", name: "ForumPollOption_Id", newName: "Option_Id"); + RenameColumn(table: "dbo.ForumPollOptions", name: "ForumPoll_Id", newName: "Poll_Id"); + RenameIndex(table: "dbo.ForumCategories", name: "IX_ForumCategory_Id", newName: "IX_Parent_Id"); + RenameIndex(table: "dbo.ACLForumPermissions", name: "IX_ForumCategory_Id", newName: "IX_Parent_Id"); + RenameIndex(table: "dbo.ForumTopics", name: "IX_ForumCategory_Id", newName: "IX_Parent_Id"); + RenameIndex(table: "dbo.ForumPosts", name: "IX_ForumTopic_Id", newName: "IX_Parent_Id"); + RenameIndex(table: "dbo.ForumPostEdits", name: "IX_ForumPost_Id", newName: "IX_Parent_Id"); + RenameIndex(table: "dbo.Likes", name: "IX_ForumPost_Id", newName: "IX_Post_Id"); + RenameIndex(table: "dbo.ForumPollOptions", name: "IX_ForumPoll_Id", newName: "IX_Poll_Id"); + RenameIndex(table: "dbo.ForumPollVotes", name: "IX_ForumPollOption_Id", newName: "IX_Option_Id"); + AddColumn("dbo.ForumPolls", "Parent_Id", c => c.String(maxLength: 128)); + CreateIndex("dbo.ForumPolls", "Parent_Id"); + AddForeignKey("dbo.ForumPolls", "Parent_Id", "dbo.ForumTopics", "Id"); + } + + public override void Down() + { + DropForeignKey("dbo.ForumPolls", "Parent_Id", "dbo.ForumTopics"); + DropIndex("dbo.ForumPolls", new[] { "Parent_Id" }); + DropColumn("dbo.ForumPolls", "Parent_Id"); + RenameIndex(table: "dbo.ForumPollVotes", name: "IX_Option_Id", newName: "IX_ForumPollOption_Id"); + RenameIndex(table: "dbo.ForumPollOptions", name: "IX_Poll_Id", newName: "IX_ForumPoll_Id"); + RenameIndex(table: "dbo.Likes", name: "IX_Post_Id", newName: "IX_ForumPost_Id"); + RenameIndex(table: "dbo.ForumPostEdits", name: "IX_Parent_Id", newName: "IX_ForumPost_Id"); + RenameIndex(table: "dbo.ForumPosts", name: "IX_Parent_Id", newName: "IX_ForumTopic_Id"); + RenameIndex(table: "dbo.ForumTopics", name: "IX_Parent_Id", newName: "IX_ForumCategory_Id"); + RenameIndex(table: "dbo.ACLForumPermissions", name: "IX_Parent_Id", newName: "IX_ForumCategory_Id"); + RenameIndex(table: "dbo.ForumCategories", name: "IX_Parent_Id", newName: "IX_ForumCategory_Id"); + RenameColumn(table: "dbo.ForumPollOptions", name: "Poll_Id", newName: "ForumPoll_Id"); + RenameColumn(table: "dbo.ForumPollVotes", name: "Option_Id", newName: "ForumPollOption_Id"); + RenameColumn(table: "dbo.Likes", name: "Post_Id", newName: "ForumPost_Id"); + RenameColumn(table: "dbo.ForumPostEdits", name: "Parent_Id", newName: "ForumPost_Id"); + RenameColumn(table: "dbo.ForumPosts", name: "Parent_Id", newName: "ForumTopic_Id"); + RenameColumn(table: "dbo.ForumTopics", name: "Parent_Id", newName: "ForumCategory_Id"); + RenameColumn(table: "dbo.ACLForumPermissions", name: "Parent_Id", newName: "ForumCategory_Id"); + RenameColumn(table: "dbo.ForumCategories", name: "Parent_Id", newName: "ForumCategory_Id"); + } + } +} |
