using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace VigilCareClinicalAPI.Migrations { /// public partial class AddExternalResourceIdentifiers : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "external_resource_identifiers", columns: table => new { id = table.Column(type: "uuid", nullable: false, defaultValueSql: "gen_random_uuid()"), resource_type = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), internal_id = table.Column(type: "uuid", nullable: false), system = table.Column(type: "character varying(500)", maxLength: 500, nullable: false), value = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "NOW()") }, constraints: table => { table.PrimaryKey("PK_external_resource_identifiers", x => x.id); }); migrationBuilder.CreateIndex( name: "IX_external_resource_identifiers_resource_type_internal_id", table: "external_resource_identifiers", columns: new[] { "resource_type", "internal_id" }); migrationBuilder.CreateIndex( name: "IX_external_resource_identifiers_resource_type_system_value", table: "external_resource_identifiers", columns: new[] { "resource_type", "system", "value" }, unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "external_resource_identifiers"); } } }