using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Fengling.AuthService.Data.Migrations { /// public partial class AddOAuthApplications : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "OAuthApplications", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), ClientId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), ClientSecret = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), DisplayName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), RedirectUris = table.Column(type: "text[]", nullable: false), PostLogoutRedirectUris = table.Column(type: "text[]", nullable: false), Scopes = table.Column(type: "text[]", nullable: false), GrantTypes = table.Column(type: "text[]", nullable: false), ClientType = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), ConsentType = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), Status = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OAuthApplications", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_OAuthApplications_ClientId", table: "OAuthApplications", column: "ClientId", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "OAuthApplications"); } } }