mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
83 lines
2.6 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|