1
0
mirror of https://github.com/chyzy/RSystem-MVC synced 2024-08-25 12:11:57 +02:00
RSystem-MVC-Fork/RSystem/Migrations/201801062355377_AddPointMultipilersToSpecialization.cs
2018-04-17 11:20:49 +02:00

37 lines
1.4 KiB
C#

namespace RSystem.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddPointMultipilersToSpecialization : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.PointsMultipilers",
c => new
{
PointsMultipilerId = c.Int(nullable: false, identity: true),
SpecializationId = c.Int(nullable: false),
MaturaSubjectId = c.Int(nullable: false),
Multipiler = c.Single(nullable: false),
})
.PrimaryKey(t => t.PointsMultipilerId)
.ForeignKey("dbo.MaturaSubjects", t => t.MaturaSubjectId, cascadeDelete: true)
.ForeignKey("dbo.Specializations", t => t.SpecializationId, cascadeDelete: true)
.Index(t => t.SpecializationId)
.Index(t => t.MaturaSubjectId);
}
public override void Down()
{
DropForeignKey("dbo.PointsMultipilers", "SpecializationId", "dbo.Specializations");
DropForeignKey("dbo.PointsMultipilers", "MaturaSubjectId", "dbo.MaturaSubjects");
DropIndex("dbo.PointsMultipilers", new[] { "MaturaSubjectId" });
DropIndex("dbo.PointsMultipilers", new[] { "SpecializationId" });
DropTable("dbo.PointsMultipilers");
}
}
}