using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GerbilManagerWebAPI.Migrations
{
///
public partial class AddVerifiedGerbilAndManualFlag : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "IsManual",
table: "Litters",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "IsManual",
table: "Gerbils",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "IsManual",
table: "Contacts",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "GerbilOverrides",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
GerbilId = table.Column(type: "uuid", nullable: false),
EntityName = table.Column(type: "text", nullable: true),
IsVerified = table.Column(type: "boolean", nullable: false),
OverrideJson = table.Column(type: "text", nullable: false),
SnapshotJson = table.Column(type: "text", nullable: true),
LastImportSnapshotJson = table.Column(type: "text", nullable: true),
LastImportDiffJson = table.Column(type: "text", nullable: true),
Note = table.Column(type: "text", nullable: true),
VerifiedAt = table.Column(type: "timestamp with time zone", nullable: true),
UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GerbilOverrides", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_GerbilOverrides_GerbilId",
table: "GerbilOverrides",
column: "GerbilId",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GerbilOverrides");
migrationBuilder.DropColumn(
name: "IsManual",
table: "Litters");
migrationBuilder.DropColumn(
name: "IsManual",
table: "Gerbils");
migrationBuilder.DropColumn(
name: "IsManual",
table: "Contacts");
}
}
}