using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Govor.Data.Migrations { /// public partial class update_sessions_model : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.RenameColumn( name: "RefreshToken", table: "UserSessions", newName: "RefreshTokenHash"); migrationBuilder.AlterColumn( name: "Username", table: "Users", type: "character varying(50)", maxLength: 50, nullable: false, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "PasswordHash", table: "Users", type: "character varying(128)", maxLength: 128, nullable: false, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Description", table: "Users", type: "character varying(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.CreateIndex( name: "IX_Users_Username", table: "Users", column: "Username", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropIndex( name: "IX_Users_Username", table: "Users"); migrationBuilder.RenameColumn( name: "RefreshTokenHash", table: "UserSessions", newName: "RefreshToken"); migrationBuilder.AlterColumn( name: "Username", table: "Users", type: "text", nullable: false, oldClrType: typeof(string), oldType: "character varying(50)", oldMaxLength: 50); migrationBuilder.AlterColumn( name: "PasswordHash", table: "Users", type: "text", nullable: false, oldClrType: typeof(string), oldType: "character varying(128)", oldMaxLength: 128); migrationBuilder.AlterColumn( name: "Description", table: "Users", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "character varying(500)", oldMaxLength: 500, oldNullable: true); } } }