using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; using NodaTime; #nullable disable namespace DysonNetwork.Sphere.Migrations { /// public partial class RemovePublicationSites : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "publication_pages"); migrationBuilder.DropTable( name: "publication_sites"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "publication_sites", columns: table => new { id = table.Column(type: "uuid", nullable: false), publisher_id = table.Column(type: "uuid", nullable: false), account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true), description = table.Column(type: "character varying(8192)", maxLength: 8192, nullable: true), name = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), slug = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("pk_publication_sites", x => x.id); table.ForeignKey( name: "fk_publication_sites_publishers_publisher_id", column: x => x.publisher_id, principalTable: "publishers", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "publication_pages", columns: table => new { id = table.Column(type: "uuid", nullable: false), site_id = table.Column(type: "uuid", nullable: false), config = table.Column>(type: "jsonb", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true), path = table.Column(type: "character varying(8192)", maxLength: 8192, nullable: false), preset = table.Column(type: "character varying(8192)", maxLength: 8192, nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("pk_publication_pages", x => x.id); table.ForeignKey( name: "fk_publication_pages_publication_sites_site_id", column: x => x.site_id, principalTable: "publication_sites", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "ix_publication_pages_site_id", table: "publication_pages", column: "site_id"); migrationBuilder.CreateIndex( name: "ix_publication_sites_publisher_id", table: "publication_sites", column: "publisher_id"); } } }