fix searching of push tokens

This commit is contained in:
Artemy
2026-03-01 19:17:54 +07:00
parent dc6bf14e43
commit ecb9f4581d
5 changed files with 946 additions and 11 deletions
@@ -0,0 +1,82 @@
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);
}
}
}