using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
///
public partial class PublisherFeatures : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "publisher_type",
table: "publishers",
newName: "type");
migrationBuilder.CreateTable(
name: "custom_apps",
columns: table => new
{
id = table.Column(type: "uuid", nullable: false),
slug = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false),
name = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false),
status = table.Column(type: "integer", nullable: false),
verified_at = table.Column(type: "timestamp with time zone", nullable: true),
verified_as = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true),
publisher_id = table.Column(type: "uuid", nullable: false),
created_at = table.Column(type: "timestamp with time zone", nullable: false),
updated_at = table.Column(type: "timestamp with time zone", nullable: false),
deleted_at = table.Column(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_custom_apps", x => x.id);
table.ForeignKey(
name: "fk_custom_apps_publishers_publisher_id",
column: x => x.publisher_id,
principalTable: "publishers",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "publisher_features",
columns: table => new
{
id = table.Column(type: "uuid", nullable: false),
flag = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false),
expired_at = table.Column(type: "timestamp with time zone", nullable: true),
publisher_id = table.Column(type: "uuid", nullable: false),
created_at = table.Column(type: "timestamp with time zone", nullable: false),
updated_at = table.Column(type: "timestamp with time zone", nullable: false),
deleted_at = table.Column(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_publisher_features", x => x.id);
table.ForeignKey(
name: "fk_publisher_features_publishers_publisher_id",
column: x => x.publisher_id,
principalTable: "publishers",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_custom_apps_publisher_id",
table: "custom_apps",
column: "publisher_id");
migrationBuilder.CreateIndex(
name: "ix_publisher_features_publisher_id",
table: "publisher_features",
column: "publisher_id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "custom_apps");
migrationBuilder.DropTable(
name: "publisher_features");
migrationBuilder.RenameColumn(
name: "type",
table: "publishers",
newName: "publisher_type");
}
}
}