using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Teknik.IdentityServer.Data.Migrations.ApplicationDb { public partial class AuthToken : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AuthTokens", columns: table => new { AuthTokenId = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: true), ApplicationUserId = table.Column(type: "nvarchar(450)", nullable: true), Token = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AuthTokens", x => x.AuthTokenId); table.ForeignKey( name: "FK_AuthTokens_AspNetUsers_ApplicationUserId", column: x => x.ApplicationUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_AuthTokens_ApplicationUserId", table: "AuthTokens", column: "ApplicationUserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AuthTokens"); } } }