116 lines
5.2 KiB
C#
116 lines
5.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Web.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class initial : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Addresss",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Street = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
City = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
State = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Country = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
CVR = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Addresss", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Banners",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
LinkUrl = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Banners", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Footers",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Owner = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
LastUpdated = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
ImageUlr = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Sitecopyright = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Footers", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Pages",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Slug = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
BannerId = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Pages", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Pages_Banners_BannerId",
|
|
column: x => x.BannerId,
|
|
principalTable: "Banners",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Pages_BannerId",
|
|
table: "Pages",
|
|
column: "BannerId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Addresss");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Footers");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Pages");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Banners");
|
|
}
|
|
}
|
|
}
|