Files
Govor/Govor.Data/Migrations/20260301120522_FixPushTokensIndexs.cs
T
2026-03-01 19:17:54 +07:00

83 lines
2.6 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Govor.Data.Migrations
{
/// <inheritdoc />
public partial class FixPushTokensIndexs : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_UserPushTokens_UserId",
table: "UserPushTokens");
migrationBuilder.AlterColumn<string>(
name: "Token",
table: "UserPushTokens",
type: "character varying(512)",
maxLength: 512,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Provider",
table: "UserPushTokens",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Platform",
table: "UserPushTokens",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Token",
table: "UserPushTokens",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(512)",
oldMaxLength: 512);
migrationBuilder.AlterColumn<string>(
name: "Provider",
table: "UserPushTokens",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Platform",
table: "UserPushTokens",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.CreateIndex(
name: "IX_UserPushTokens_UserId",
table: "UserPushTokens",
column: "UserId",
unique: true);
}
}
}