kehati/Migrations/20260721071042_LokasiFauna.cs

48 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace kehati.Migrations
{
/// <inheritdoc />
public partial class LokasiFauna : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ms_lokasi_fauna",
columns: table => new
{
MsLokasiFaunaId = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ms_lokasi_id = table.Column<int>(type: "integer", nullable: false),
ms_fauna_id = table.Column<int>(type: "integer", nullable: false),
created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
updated_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
},
constraints: table =>
{
table.PrimaryKey("PK_MsLokasiFaunaId", x => x.MsLokasiFaunaId);
table.ForeignKey(
name: "FK_LokasiId",
column: x => x.ms_lokasi_id,
principalTable: "ms_lokasi",
principalColumn: "MsLokasiId");
table.ForeignKey(
name: "FK_FaunaId",
column: x => x.ms_fauna_id,
principalTable: "ms_fauna",
principalColumn: "MsFaunaId");
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}