IW4M-Admin/Data/Migrations/Postgresql/20180602041758_AddClientMeta.cs

53 lines
2.1 KiB
C#
Raw Normal View History

2018-09-23 20:45:54 -04:00
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using System;
using System.Collections.Generic;
namespace Data.Migrations.Postgresql
{
public partial class AddClientMeta : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EFMeta",
columns: table => new
{
MetaId = table.Column<int>(nullable: false)
2018-09-23 20:45:54 -04:00
.Annotation("Sqlite:Autoincrement", true)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Active = table.Column<bool>(nullable: false),
ClientId = table.Column<int>(nullable: false),
Created = table.Column<DateTime>(nullable: false),
Extra = table.Column<string>(nullable: true),
Key = table.Column<string>(nullable: false),
Updated = table.Column<DateTime>(nullable: false),
Value = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EFMeta", x => x.MetaId);
table.ForeignKey(
name: "FK_EFMeta_EFClients_ClientId",
column: x => x.ClientId,
principalTable: "EFClients",
principalColumn: "ClientId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_EFMeta_ClientId",
table: "EFMeta",
column: "ClientId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EFMeta");
}
}
}