1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

[SM-678] ClientSecret migration (#2943)

* Init ClientSecret migration

* Fix unit tests

* Move to src/Sql/dbo_future

* Formatting changes

* Update migration date for next release

* Swap to just executing sp_refreshview

* Fix formatting

* Add EF Migrations

* Rename to ClientSecretHash

* Fix unit test

* EF column rename

* Batch the migration

* Fix formatting

* Add deprecation notice to property

* Move data migration

* Swap to CREATE OR ALTER
This commit is contained in:
Thomas Avery
2023-06-21 13:16:06 -05:00
committed by GitHub
parent 7f8b6c0bce
commit bb3a9daf98
24 changed files with 7011 additions and 41 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
public partial class ClientSecretHash : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientSecret",
table: "ApiKey");
migrationBuilder.AddColumn<string>(
name: "ClientSecretHash",
table: "ApiKey",
type: "varchar(128)",
maxLength: 128,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientSecretHash",
table: "ApiKey");
migrationBuilder.AddColumn<string>(
name: "ClientSecret",
table: "ApiKey",
type: "varchar(30)",
maxLength: 30,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
}

View File

@ -1335,9 +1335,9 @@ namespace Bit.MySqlMigrations.Migrations
b.Property<Guid>("Id")
.HasColumnType("char(36)");
b.Property<string>("ClientSecret")
.HasMaxLength(30)
.HasColumnType("varchar(30)");
b.Property<string>("ClientSecretHash")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime(6)");