1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Sync EF migrations for .NET / EF Core 8 (#4448)

* Sync EF migrations for .NET 8

* Format

* Redo migrations with billing fix

* Forgot to format again
This commit is contained in:
Matt Bishop
2024-07-02 10:08:34 -04:00
committed by GitHub
parent 554a004d7a
commit e8c5d73062
10 changed files with 8323 additions and 23 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,125 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class Net8Sync : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
table: "ProviderInvoiceItem");
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "InvoiceNumber",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Discriminator",
table: "AccessPolicy",
type: "character varying(34)",
maxLength: 34,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "InvoiceNumber",
table: "ProviderInvoiceItem",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Discriminator",
table: "AccessPolicy",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(34)",
oldMaxLength: 34);
migrationBuilder.CreateIndex(
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
table: "ProviderInvoiceItem",
columns: new[] { "Id", "InvoiceId" },
unique: true);
}
}

View File

@ -18,7 +18,7 @@ namespace Bit.PostgresMigrations.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False")
.HasAnnotation("ProductVersion", "7.0.16")
.HasAnnotation("ProductVersion", "8.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@ -696,19 +696,23 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("integer");
b.Property<string>("ClientName")
.HasColumnType("text");
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("Created")
.HasColumnType("timestamp with time zone");
b.Property<string>("InvoiceId")
.HasColumnType("text");
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("InvoiceNumber")
.HasColumnType("text");
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("PlanName")
.HasColumnType("text");
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<Guid>("ProviderId")
.HasColumnType("uuid");
@ -723,9 +727,6 @@ namespace Bit.PostgresMigrations.Migrations
b.HasIndex("ProviderId");
b.HasIndex("Id", "InvoiceId")
.IsUnique();
b.ToTable("ProviderInvoiceItem", (string)null);
});
@ -1563,7 +1564,8 @@ namespace Bit.PostgresMigrations.Migrations
b.Property<string>("Discriminator")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(34)
.HasColumnType("character varying(34)");
b.Property<bool>("Read")
.HasColumnType("boolean");