using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; using NodaTime; #nullable disable namespace DysonNetwork.Pass.Migrations { /// public partial class AddPresenceActivity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "background_id", table: "realms"); migrationBuilder.DropColumn( name: "picture_id", table: "realms"); migrationBuilder.CreateTable( name: "presence_activities", columns: table => new { id = table.Column(type: "uuid", nullable: false), type = table.Column(type: "integer", nullable: false), manual_id = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), title = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), subtitle = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), caption = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), meta = table.Column>(type: "jsonb", nullable: true), lease_minutes = table.Column(type: "integer", nullable: false), lease_expires_at = table.Column(type: "timestamp with time zone", nullable: false), account_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_presence_activities", x => x.id); table.ForeignKey( name: "fk_presence_activities_accounts_account_id", column: x => x.account_id, principalTable: "accounts", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "ix_presence_activities_account_id", table: "presence_activities", column: "account_id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "presence_activities"); migrationBuilder.AddColumn( name: "background_id", table: "realms", type: "character varying(32)", maxLength: 32, nullable: true); migrationBuilder.AddColumn( name: "picture_id", table: "realms", type: "character varying(32)", maxLength: 32, nullable: true); } } }