using Microsoft.EntityFrameworkCore.Migrations; using NodaTime; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Catalogger.Backend.Database.Migrations { /// public partial class AddDashboardTokens : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "api_tokens", columns: table => new { id = table .Column(type: "integer", nullable: false) .Annotation( "Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn ), dashboard_token = table.Column(type: "text", nullable: false), user_id = table.Column(type: "text", nullable: false), access_token = table.Column(type: "text", nullable: false), refresh_token = table.Column(type: "text", nullable: true), expires_at = table.Column( type: "timestamp with time zone", nullable: false ), }, constraints: table => { table.PrimaryKey("pk_api_tokens", x => x.id); } ); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable(name: "api_tokens"); } } }