using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PlaylistShared.Api.Data.Migrations { /// public partial class AddYandexAuthSessions : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "YandexAuthSessions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "uniqueidentifier", nullable: true), QrCodeUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), SerializedCookies = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), ConfirmedAt = table.Column(type: "datetime2", nullable: true), IsConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), TrackId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), CsfrToken = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true) }, constraints: table => { table.PrimaryKey("PK_YandexAuthSessions", x => x.Id); table.ForeignKey( name: "FK_YandexAuthSessions_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateIndex( name: "IX_YandexAuthSessions_UserId", table: "YandexAuthSessions", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "YandexAuthSessions"); } } }