Movies included in database as well and handled in site

This commit is contained in:
2019-01-21 20:52:22 +01:00
parent 19fc2475fa
commit f5a597fcdb
33 changed files with 1418 additions and 59 deletions

View File

@ -0,0 +1,32 @@
namespace Vidly.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class MovieGenreAdded : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.MovieGenres",
c => new
{
Id = c.Byte(nullable: false),
Name = c.String(),
})
.PrimaryKey(t => t.Id);
AddColumn("dbo.Movies", "MovieGenreId", c => c.Byte(nullable: false));
CreateIndex("dbo.Movies", "MovieGenreId");
AddForeignKey("dbo.Movies", "MovieGenreId", "dbo.MovieGenres", "Id", cascadeDelete: true);
}
public override void Down()
{
DropForeignKey("dbo.Movies", "MovieGenreId", "dbo.MovieGenres");
DropIndex("dbo.Movies", new[] { "MovieGenreId" });
DropColumn("dbo.Movies", "MovieGenreId");
DropTable("dbo.MovieGenres");
}
}
}