mirror of https://github.com/EasyAbp/EShop.git
33 changed files with 7822 additions and 60 deletions
File diff suppressed because it is too large
@ -0,0 +1,33 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace EShopSample.Migrations |
||||
|
{ |
||||
|
public partial class RenamedCodeToName : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.RenameColumn( |
||||
|
name: "Code", |
||||
|
newName: "Name", |
||||
|
table: "EShopProductsProductSkus"); |
||||
|
|
||||
|
migrationBuilder.RenameColumn( |
||||
|
name: "Code", |
||||
|
newName: "UniqueName", |
||||
|
table: "EShopProductsProducts"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.RenameColumn( |
||||
|
name: "Name", |
||||
|
newName: "Code", |
||||
|
table: "EShopProductsProductSkus"); |
||||
|
|
||||
|
migrationBuilder.RenameColumn( |
||||
|
name: "UniqueName", |
||||
|
newName: "Code", |
||||
|
table: "EShopProductsProducts"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,40 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace EShopSample.Migrations |
||||
|
{ |
||||
|
public partial class MadeUniqueNameUniqueIndex : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "UniqueName", |
||||
|
table: "EShopProductsProducts", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "nvarchar(max)", |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_EShopProductsProducts_UniqueName", |
||||
|
table: "EShopProductsProducts", |
||||
|
column: "UniqueName", |
||||
|
unique: true, |
||||
|
filter: "[UniqueName] IS NOT NULL"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_EShopProductsProducts_UniqueName", |
||||
|
table: "EShopProductsProducts"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "UniqueName", |
||||
|
table: "EShopProductsProducts", |
||||
|
type: "nvarchar(max)", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(string), |
||||
|
oldNullable: true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue