2024-01-16 15:08:55 +01:00
|
|
|
|
using Bit.EfShared;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
2023-12-28 21:04:45 +01:00
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace Bit.SqliteMigrations.Migrations;
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public partial class GrantIdWithIndexes : Migration
|
|
|
|
|
{
|
2024-01-16 15:08:55 +01:00
|
|
|
|
private const string _scriptLocationTemplate = "2023-12-04_00_{0}_GrantIndexes.sql";
|
|
|
|
|
|
2023-12-28 21:04:45 +01:00
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
2024-01-16 15:08:55 +01:00
|
|
|
|
migrationBuilder.SqlResource(_scriptLocationTemplate);
|
2023-12-28 21:04:45 +01:00
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_Grant_Key",
|
|
|
|
|
table: "Grant",
|
|
|
|
|
column: "Key",
|
|
|
|
|
unique: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
2024-01-16 15:08:55 +01:00
|
|
|
|
migrationBuilder.SqlResource(_scriptLocationTemplate);
|
2023-12-28 21:04:45 +01:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropIndex(
|
|
|
|
|
name: "IX_Grant_Key",
|
|
|
|
|
table: "Grant");
|
|
|
|
|
}
|
|
|
|
|
}
|