123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
- namespace UnivateProperties_API.Migrations
- {
- public partial class PaymentsTable : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Payments",
- columns: table => new
- {
- Id = table.Column<int>(nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
- Created = table.Column<DateTime>(nullable: false),
- Modified = table.Column<DateTime>(nullable: false),
- ModifiedBy = table.Column<string>(nullable: true),
- IsDeleted = table.Column<bool>(nullable: false),
- TimeshareWeekId = table.Column<int>(nullable: true),
- PropertyId = table.Column<int>(nullable: true),
- Amount = table.Column<decimal>(nullable: false),
- PaymentStatus = table.Column<string>(nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Payments", x => x.Id);
- table.ForeignKey(
- name: "FK_Payments_Properties_PropertyId",
- column: x => x.PropertyId,
- principalTable: "Properties",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_Payments_Weeks_TimeshareWeekId",
- column: x => x.TimeshareWeekId,
- principalTable: "Weeks",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_Payments_PropertyId",
- table: "Payments",
- column: "PropertyId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Payments_TimeshareWeekId",
- table: "Payments",
- column: "TimeshareWeekId");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Payments");
- }
- }
- }
|