mirror of
https://github.com/bitwarden/server.git
synced 2024-12-05 14:23:30 +01:00
b97a1a9ed2
* SQLite scripts to apply autoincrementing Id key * Drop erroneous Id column if created
35 lines
886 B
C#
35 lines
886 B
C#
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");
|
|
}
|
|
}
|