1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-28 13:15:12 +01:00
bitwarden-server/util/SqliteMigrations/Migrations/20231214162537_GrantIdWithIndexes.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
886 B
C#
Raw Normal View History

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