using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IoTSharp.Data.MySql.Migrations { public partial class refreshtoken : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "RefreshTokens", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UserId = table.Column(type: "varchar(255)", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Token = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), JwtId = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsUsed = table.Column(type: "tinyint(1)", nullable: false), IsRevorked = table.Column(type: "tinyint(1)", nullable: false), AddedDate = table.Column(type: "datetime(6)", nullable: false), ExpiryDate = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RefreshTokens", x => x.Id); table.ForeignKey( name: "FK_RefreshTokens_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_RefreshTokens_UserId", table: "RefreshTokens", column: "UserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "RefreshTokens"); } } }