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

[AC-2551] Fix migration files (#4854)

* Correctly regenerate EF migration files

* Run dotnet format
This commit is contained in:
Alex Morask
2024-10-04 12:05:44 -04:00
committed by GitHub
parent 0496085c39
commit c44988694d
9 changed files with 147 additions and 69 deletions

View File

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations
{
/// <inheritdoc />
public partial class AddClientOrganizationMigrationRecordTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View File

@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Bit.PostgresMigrations.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20241004140910_AddClientOrganizationMigrationRecordTable")]
[Migration("20241004154531_AddClientOrganizationMigrationRecordTable")]
partial class AddClientOrganizationMigrationRecordTable
{
/// <inheritdoc />

View File

@ -0,0 +1,47 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class AddClientOrganizationMigrationRecordTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ClientOrganizationMigrationRecord",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false),
ProviderId = table.Column<Guid>(type: "uuid", nullable: false),
PlanType = table.Column<byte>(type: "smallint", nullable: false),
Seats = table.Column<int>(type: "integer", nullable: false),
MaxStorageGb = table.Column<short>(type: "smallint", nullable: true),
GatewayCustomerId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
GatewaySubscriptionId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
ExpirationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
MaxAutoscaleSeats = table.Column<int>(type: "integer", nullable: true),
Status = table.Column<byte>(type: "smallint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClientOrganizationMigrationRecord", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_ClientOrganizationMigrationRecord_ProviderId_OrganizationId",
table: "ClientOrganizationMigrationRecord",
columns: new[] { "ProviderId", "OrganizationId" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ClientOrganizationMigrationRecord");
}
}