23 lines
680 B
C#
23 lines
680 B
C#
namespace CodeFirstExistingDatabase.Migrations
|
|
{
|
|
using System;
|
|
using System.Data.Entity.Migrations;
|
|
|
|
public partial class RenameTitleColumnToNameInCoursesTable : DbMigration
|
|
{
|
|
public override void Up()
|
|
{
|
|
AddColumn("dbo.Courses", "Name", c => c.String(nullable: false));
|
|
Sql("UPDATE Courses SET Name = Title");
|
|
DropColumn("dbo.Courses", "Title");
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
AddColumn("dbo.Courses", "Title", c => c.String(nullable: false));
|
|
Sql("UPDATE Courses SET Title = Name ");
|
|
DropColumn("dbo.Courses", "Name");
|
|
}
|
|
}
|
|
}
|