-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy path20190727083300_AddedContentLocalization.cs
More file actions
55 lines (50 loc) · 2.42 KB
/
20190727083300_AddedContentLocalization.cs
File metadata and controls
55 lines (50 loc) · 2.42 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace SimplCommerce.Db.MsSql.Migrations
{
public partial class AddedContentLocalization : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Localization_LocalizedContentProperty",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
EntityId = table.Column<long>(nullable: false),
EntityType = table.Column<string>(maxLength: 450, nullable: true),
CultureId = table.Column<string>(nullable: false),
ProperyName = table.Column<string>(maxLength: 450, nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Localization_LocalizedContentProperty", x => x.Id);
table.ForeignKey(
name: "FK_Localization_LocalizedContentProperty_Localization_Culture_CultureId",
column: x => x.CultureId,
principalTable: "Localization_Culture",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "Core_AppSetting",
columns: new[] { "Id", "IsVisibleInCommonSettingPage", "Module", "Value" },
values: new object[] { "Localization.LocalizedConentEnable", true, "Localization", "true" });
migrationBuilder.CreateIndex(
name: "IX_Localization_LocalizedContentProperty_CultureId",
table: "Localization_LocalizedContentProperty",
column: "CultureId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Localization_LocalizedContentProperty");
migrationBuilder.DeleteData(
table: "Core_AppSetting",
keyColumn: "Id",
keyValue: "Localization.LocalizedConentEnable");
}
}
}