IW4M-Admin/SharedLibraryCore/Migrations/Sqlite/20180602041758_AddClientMeta.cs
RaidMax 36a02b3d7b update for database provider specific migrations
fix issues with live radar
2020-11-27 21:52:52 -06:00

53 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using System;
using System.Collections.Generic;
namespace SharedLibraryCore.Migrations.Sqlite
{
public partial class AddClientMeta : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EFMeta",
columns: table => new
{
MetaId = table.Column<int>(nullable: false)
.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");
}
}
}