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