summaryrefslogtreecommitdiff
path: root/Project-Unite/Migrations/201703161150361_voting-system-forums.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-20 16:45:17 -0400
committerMichael <[email protected]>2017-03-20 16:45:17 -0400
commitcdc61eb4ea5309769ad4db84d92594e4dc3dff67 (patch)
treea8297a7aecc4376f07a497a5e02ab5ff165bfbd3 /Project-Unite/Migrations/201703161150361_voting-system-forums.cs
parentd9f475e1f33bbf39ca0d79d7a6b0c2fd501b4f2d (diff)
downloadproject-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.gz
project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.bz2
project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.zip
Initial commit (azure deploy test)
Diffstat (limited to 'Project-Unite/Migrations/201703161150361_voting-system-forums.cs')
-rw-r--r--Project-Unite/Migrations/201703161150361_voting-system-forums.cs61
1 files changed, 61 insertions, 0 deletions
diff --git a/Project-Unite/Migrations/201703161150361_voting-system-forums.cs b/Project-Unite/Migrations/201703161150361_voting-system-forums.cs
new file mode 100644
index 0000000..62240fb
--- /dev/null
+++ b/Project-Unite/Migrations/201703161150361_voting-system-forums.cs
@@ -0,0 +1,61 @@
+namespace Project_Unite.Migrations
+{
+ using System;
+ using System.Data.Entity.Migrations;
+
+ public partial class votingsystemforums : DbMigration
+ {
+ public override void Up()
+ {
+ CreateTable(
+ "dbo.ForumPostEdits",
+ c => new
+ {
+ Id = c.String(nullable: false, maxLength: 128),
+ UserId = c.String(),
+ EditReason = c.String(),
+ PreviousState = c.String(),
+ EditedAt = c.DateTime(nullable: false),
+ ForumPost_Id = c.String(maxLength: 128),
+ })
+ .PrimaryKey(t => t.Id)
+ .ForeignKey("dbo.ForumPosts", t => t.ForumPost_Id)
+ .Index(t => t.ForumPost_Id);
+
+ CreateTable(
+ "dbo.Likes",
+ c => new
+ {
+ Id = c.String(nullable: false, maxLength: 128),
+ Post_Id = c.String(maxLength: 128),
+ User_Id = c.String(maxLength: 128),
+ })
+ .PrimaryKey(t => t.Id)
+ .ForeignKey("dbo.ForumPosts", t => t.Post_Id)
+ .ForeignKey("dbo.AspNetUsers", t => t.User_Id)
+ .Index(t => t.Post_Id)
+ .Index(t => t.User_Id);
+
+ AddColumn("dbo.ForumTopics", "Votes", c => c.Int(nullable: false));
+ AddColumn("dbo.ForumTopics", "StartedAt", c => c.DateTime(nullable: false));
+ AddColumn("dbo.ForumPosts", "PostedAt", c => c.DateTime(nullable: false));
+ AddColumn("dbo.AspNetRoles", "CanDeleteForumCategories", c => c.Boolean());
+ }
+
+ public override void Down()
+ {
+ DropForeignKey("dbo.Likes", "User_Id", "dbo.AspNetUsers");
+ DropForeignKey("dbo.Likes", "Post_Id", "dbo.ForumPosts");
+ DropForeignKey("dbo.ForumPostEdits", "ForumPost_Id", "dbo.ForumPosts");
+ DropIndex("dbo.Likes", new[] { "User_Id" });
+ DropIndex("dbo.Likes", new[] { "Post_Id" });
+ DropIndex("dbo.ForumPostEdits", new[] { "ForumPost_Id" });
+ DropColumn("dbo.AspNetRoles", "CanDeleteForumCategories");
+ DropColumn("dbo.ForumPosts", "PostedAt");
+ DropColumn("dbo.ForumTopics", "StartedAt");
+ DropColumn("dbo.ForumTopics", "Votes");
+ DropTable("dbo.Likes");
+ DropTable("dbo.ForumPostEdits");
+ }
+ }
+}