namespace Vrh.iScheduler.Report.Lib.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class ChangeSchemaName : DbMigration
    {
        public override void Up()
        {
            MoveTable(name: "dbo.SchedulerReportPackageItems", newSchema: "iSchedulerReports");
            MoveTable(name: "dbo.SchedulerReportPackages", newSchema: "iSchedulerReports");
            DropForeignKey("dbo.SchedulerReportPackageItems", "SchedulerReportPackageId", "dbo.SchedulerReportPackages");
            AddForeignKey("iSchedulerReports.SchedulerReportPackageItems", "SchedulerReportPackageId", "iSchedulerReports.SchedulerReportPackages", "Id");
        }
        
        public override void Down()
        {
            DropForeignKey("iSchedulerReports.SchedulerReportPackageItems", "SchedulerReportPackageId", "iSchedulerReports.SchedulerReportPackages");
            AddForeignKey("dbo.SchedulerReportPackageItems", "SchedulerReportPackageId", "dbo.SchedulerReportPackages", "Id", cascadeDelete: true);
            MoveTable(name: "iSchedulerReports.SchedulerReportPackages", newSchema: "dbo");
            MoveTable(name: "iSchedulerReports.SchedulerReportPackageItems", newSchema: "dbo");
        }
    }
}
