1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-04 20:50:21 -05:00

fix : [dbo].[providers].[discountId] was added to the migration causing an "already exists" error with the entity framework migration. Modified the Snapshot directly to get the migration to generate correctly.

This commit is contained in:
Ike Kottlowski 2025-03-26 08:58:43 -04:00
parent 3564ec5821
commit 9164bb1d9a
No known key found for this signature in database
GPG Key ID: C86308E3DCA6D76F
6 changed files with 9 additions and 40 deletions

View File

@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Bit.MySqlMigrations.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20250325193540_CreateOpaqueKeyExchangeEntityAndProcedures")]
partial class CreateOpaqueKeyExchangeEntityAndProcedures
[Migration("20250326124705_CreateOpaqueKeyExchangeCredential")]
partial class CreateOpaqueKeyExchangeCredential
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)

View File

@ -6,18 +6,11 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.MySqlMigrations.Migrations
{
/// <inheritdoc />
public partial class CreateOpaqueKeyExchangeEntityAndProcedures : Migration
public partial class CreateOpaqueKeyExchangeCredential : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DiscountId",
table: "Provider",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OpaqueKeyExchangeCredential",
columns: table => new
@ -59,10 +52,6 @@ namespace Bit.MySqlMigrations.Migrations
{
migrationBuilder.DropTable(
name: "OpaqueKeyExchangeCredential");
migrationBuilder.DropColumn(
name: "DiscountId",
table: "Provider");
}
}
}

View File

@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Bit.PostgresMigrations.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20250325193524_CreateOpaqueKeyExchangeEntityAndProcedures")]
partial class CreateOpaqueKeyExchangeEntityAndProcedures
[Migration("20250326124645_CreateOpaqueKeyExchangeCredential")]
partial class CreateOpaqueKeyExchangeCredential
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)

View File

@ -6,17 +6,11 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.PostgresMigrations.Migrations
{
/// <inheritdoc />
public partial class CreateOpaqueKeyExchangeEntityAndProcedures : Migration
public partial class CreateOpaqueKeyExchangeCredential : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DiscountId",
table: "Provider",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "OpaqueKeyExchangeCredential",
columns: table => new
@ -52,10 +46,6 @@ namespace Bit.PostgresMigrations.Migrations
{
migrationBuilder.DropTable(
name: "OpaqueKeyExchangeCredential");
migrationBuilder.DropColumn(
name: "DiscountId",
table: "Provider");
}
}
}

View File

@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Bit.SqliteMigrations.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20250325193532_CreateOpaqueKeyExchangeEntityAndProcedures")]
partial class CreateOpaqueKeyExchangeEntityAndProcedures
[Migration("20250326124656_CreateOpaqueKeyExchangeCredential")]
partial class CreateOpaqueKeyExchangeCredential
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)

View File

@ -6,17 +6,11 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Bit.SqliteMigrations.Migrations
{
/// <inheritdoc />
public partial class CreateOpaqueKeyExchangeEntityAndProcedures : Migration
public partial class CreateOpaqueKeyExchangeCredential : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DiscountId",
table: "Provider",
type: "TEXT",
nullable: true);
migrationBuilder.CreateTable(
name: "OpaqueKeyExchangeCredential",
columns: table => new
@ -52,10 +46,6 @@ namespace Bit.SqliteMigrations.Migrations
{
migrationBuilder.DropTable(
name: "OpaqueKeyExchangeCredential");
migrationBuilder.DropColumn(
name: "DiscountId",
table: "Provider");
}
}
}