69 lines
2.0 KiB
C#
69 lines
2.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace FinlyticFundamentals.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class MakeFundamentalDataPerTicker : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_FundamentalData",
|
|
table: "FundamentalData");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Isin",
|
|
table: "FundamentalData");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "Id",
|
|
table: "FundamentalData",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValueSql: "gen_random_uuid()");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_FundamentalData",
|
|
table: "FundamentalData",
|
|
column: "Id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_FundamentalData_Ticker",
|
|
table: "FundamentalData",
|
|
column: "Ticker");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_FundamentalData",
|
|
table: "FundamentalData");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_FundamentalData_Ticker",
|
|
table: "FundamentalData");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Id",
|
|
table: "FundamentalData");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Isin",
|
|
table: "FundamentalData",
|
|
type: "text",
|
|
nullable: false,
|
|
defaultValue: "");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_FundamentalData",
|
|
table: "FundamentalData",
|
|
column: "Isin");
|
|
}
|
|
}
|
|
}
|