Files
familytree/API/FamilyTreeAPI/Migrations/20251013112634_PersonPhoto.cs
T

129 lines
6.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FamilyTreeAPI.Migrations
{
/// <inheritdoc />
public partial class PersonPhoto : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
/*
migrationBuilder.CreateTable(
name: "lookup",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
code = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: true),
description = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: true),
ltype = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true),
lactive = table.Column<bool>(type: "boolean", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_lookup", x => x.id);
});
migrationBuilder.CreateTable(
name: "person",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
firstname = table.Column<string>(type: "character varying(70)", maxLength: 70, nullable: true),
lastname = table.Column<string>(type: "character varying(70)", maxLength: 70, nullable: true),
email = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: true),
phone = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: true),
address = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
sex = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: true),
image = table.Column<string>(type: "character varying(300)", maxLength: 300, nullable: true),
alive = table.Column<bool>(type: "boolean", nullable: true),
motherid = table.Column<int>(type: "integer", nullable: true),
fatherid = table.Column<int>(type: "integer", nullable: true),
dob = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_person", x => x.id);
});
*/
migrationBuilder.CreateTable(
name: "personphoto",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
personid = table.Column<int>(type: "integer", nullable: false),
photo = table.Column<string>(type: "text", nullable: false),
imagephot = table.Column<byte[]>(type: "bytea", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_personphoto", x => x.id);
});
/*
migrationBuilder.CreateTable(
name: "relationship",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
relatepersonid = table.Column<int>(type: "integer", nullable: false),
personid = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_relationship", x => x.id);
});
migrationBuilder.CreateTable(
name: "staff",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
firstname = table.Column<string>(type: "character varying(70)", maxLength: 70, nullable: true),
lastname = table.Column<string>(type: "character varying(70)", maxLength: 70, nullable: true),
email = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: true),
phone = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: true),
stype = table.Column<int>(type: "integer", nullable: true),
srole = table.Column<int>(type: "integer", nullable: true),
spassword = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: true),
sactive = table.Column<bool>(type: "boolean", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_staff", x => x.id);
});
*/
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
/*
migrationBuilder.DropTable(
name: "lookup");
migrationBuilder.DropTable(
name: "person");
migrationBuilder.DropTable(
name: "relationship");
migrationBuilder.DropTable(
name: "staff");
*/
migrationBuilder.DropTable(
name: "personphoto");
}
}
}