using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace MoonlightServers.Api.Infrastructure.Database.Migrations { /// public partial class AddedBasicNodeEntity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "servers"); migrationBuilder.CreateTable( name: "Nodes", schema: "servers", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Name = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), HttpEndpointUrl = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), TokenId = table.Column(type: "character varying(10)", maxLength: 10, nullable: false), Token = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Nodes", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Nodes", schema: "servers"); } } }