1
0
mirror of https://github.com/chyzy/RSystem-MVC synced 2024-11-26 00:05:27 +01:00
RSystem-MVC-Fork/RSystem/Migrations/201801062355377_AddPointMultipilersToSpecialization.cs

37 lines
1.4 KiB
C#
Raw Normal View History

2018-04-17 11:20:49 +02:00
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");
}
}
}