104 lines
4.6 KiB
C#
104 lines
4.6 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace CodeLiturgy.Views.Migrations.SiteDb
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class first : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "ApplicationUser",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<string>(type: "text", nullable: false),
|
|||
|
UserName = table.Column<string>(type: "text", nullable: true),
|
|||
|
NormalizedUserName = table.Column<string>(type: "text", nullable: true),
|
|||
|
Email = table.Column<string>(type: "text", nullable: true),
|
|||
|
NormalizedEmail = table.Column<string>(type: "text", nullable: true),
|
|||
|
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
|||
|
PasswordHash = table.Column<string>(type: "text", nullable: true),
|
|||
|
SecurityStamp = table.Column<string>(type: "text", nullable: true),
|
|||
|
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
|
|||
|
PhoneNumber = table.Column<string>(type: "text", nullable: true),
|
|||
|
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
|||
|
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
|||
|
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
|||
|
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
|||
|
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_ApplicationUser", x => x.Id);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Environments",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<string>(type: "text", nullable: false),
|
|||
|
Name = table.Column<string>(type: "text", nullable: true),
|
|||
|
UserId = table.Column<string>(type: "text", nullable: true)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Environments", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_Environments_ApplicationUser_UserId",
|
|||
|
column: x => x.UserId,
|
|||
|
principalTable: "ApplicationUser",
|
|||
|
principalColumn: "Id");
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Sites",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<string>(type: "text", nullable: false),
|
|||
|
EnvironmentId = table.Column<string>(type: "text", nullable: true),
|
|||
|
Domain = table.Column<string>(type: "text", nullable: true),
|
|||
|
UrlAddress = table.Column<string>(type: "text", nullable: true),
|
|||
|
EnvironmentType = table.Column<int>(type: "integer", nullable: false),
|
|||
|
CreatedDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|||
|
LastChanged = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Sites", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_Sites_Environments_EnvironmentId",
|
|||
|
column: x => x.EnvironmentId,
|
|||
|
principalTable: "Environments",
|
|||
|
principalColumn: "Id");
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Environments_UserId",
|
|||
|
table: "Environments",
|
|||
|
column: "UserId");
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Sites_EnvironmentId",
|
|||
|
table: "Sites",
|
|||
|
column: "EnvironmentId");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Sites");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Environments");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "ApplicationUser");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|