using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; using NodaTime; #nullable disable namespace DysonNetwork.Sphere.Migrations { /// public partial class AddAccountBadges : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "badges", columns: table => new { id = table.Column(type: "uuid", nullable: false), type = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), label = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), caption = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), meta = table.Column>(type: "jsonb", nullable: false), expired_at = table.Column(type: "timestamp with time zone", nullable: true), account_id = table.Column(type: "bigint", 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_badges", x => x.id); table.ForeignKey( name: "fk_badges_accounts_account_id", column: x => x.account_id, principalTable: "accounts", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "ix_badges_account_id", table: "badges", column: "account_id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "badges"); } } }