61 lines
1.7 KiB
C#
61 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using ManagerService.Data;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ManagerService.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UpdateMix2 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Contents",
|
|
table: "GeoPoint");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "GeoPointId",
|
|
table: "Resources",
|
|
type: "integer",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Resources_GeoPointId",
|
|
table: "Resources",
|
|
column: "GeoPointId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Resources_GeoPoint_GeoPointId",
|
|
table: "Resources",
|
|
column: "GeoPointId",
|
|
principalTable: "GeoPoint",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Resources_GeoPoint_GeoPointId",
|
|
table: "Resources");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Resources_GeoPointId",
|
|
table: "Resources");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "GeoPointId",
|
|
table: "Resources");
|
|
|
|
migrationBuilder.AddColumn<List<Resource>>(
|
|
name: "Contents",
|
|
table: "GeoPoint",
|
|
type: "jsonb",
|
|
nullable: false);
|
|
}
|
|
}
|
|
}
|