using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Moonlight.Api.Database.Migrations { /// public partial class AddedUsersAndSettings : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "core"); migrationBuilder.CreateTable( name: "SettingsOptions", schema: "core", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Key = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), Value = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false) }, constraints: table => { table.PrimaryKey("PK_SettingsOptions", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", schema: "core", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Username = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), Email = table.Column(type: "character varying(254)", maxLength: 254, nullable: false), InvalidateTimestamp = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SettingsOptions", schema: "core"); migrationBuilder.DropTable( name: "Users", schema: "core"); } } }