Blame view

Vrh.iScheduler.Report/Migrations/201705190757556_RemoveSchGroup.cs 1.53 KB
ab9f2fbe   Schwirg László   Add project files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  namespace Vrh.iScheduler.Report.Lib.Migrations
  {
      using System;
      using System.Data.Entity.Migrations;
      
      public partial class RemoveSchGroup : DbMigration
      {
          public override void Up()
          {
              DropForeignKey("dbo.SchedulerReportPackages", "SchedulerReportPackageGroupId", "dbo.SchedulerReportPackageGroups");
              DropIndex("dbo.SchedulerReportPackages", new[] { "SchedulerReportPackageGroupId" });
              AddColumn("dbo.SchedulerReportPackages", "SchedulerReportPackageGroup", c => c.String());
              DropColumn("dbo.SchedulerReportPackages", "SchedulerReportPackageGroupId");
              DropTable("dbo.SchedulerReportPackageGroups");
          }
          
          public override void Down()
          {
              CreateTable(
                  "dbo.SchedulerReportPackageGroups",
                  c => new
                      {
                          Id = c.Int(nullable: false, identity: true),
                          Name = c.String(nullable: false, maxLength: 100),
                      })
                  .PrimaryKey(t => t.Id);
              
              AddColumn("dbo.SchedulerReportPackages", "SchedulerReportPackageGroupId", c => c.Int(nullable: false));
              DropColumn("dbo.SchedulerReportPackages", "SchedulerReportPackageGroup");
              CreateIndex("dbo.SchedulerReportPackages", "SchedulerReportPackageGroupId");
              AddForeignKey("dbo.SchedulerReportPackages", "SchedulerReportPackageGroupId", "dbo.SchedulerReportPackageGroups", "Id", cascadeDelete: true);
          }
      }
  }