diff --git a/util/MySqlMigrations/Migrations/20241004140901_AddClientOrganizationMigrationRecordTable.cs b/util/MySqlMigrations/Migrations/20241004140901_AddClientOrganizationMigrationRecordTable.cs deleted file mode 100644 index fac86e59e..000000000 --- a/util/MySqlMigrations/Migrations/20241004140901_AddClientOrganizationMigrationRecordTable.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Bit.MySqlMigrations.Migrations -{ - /// - public partial class AddClientOrganizationMigrationRecordTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/util/MySqlMigrations/Migrations/20241004140901_AddClientOrganizationMigrationRecordTable.Designer.cs b/util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.Designer.cs similarity index 99% rename from util/MySqlMigrations/Migrations/20241004140901_AddClientOrganizationMigrationRecordTable.Designer.cs rename to util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.Designer.cs index f4fc429d3..51865431c 100644 --- a/util/MySqlMigrations/Migrations/20241004140901_AddClientOrganizationMigrationRecordTable.Designer.cs +++ b/util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Bit.MySqlMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20241004140901_AddClientOrganizationMigrationRecordTable")] + [Migration("20241004154527_AddClientOrganizationMigrationRecordTable")] partial class AddClientOrganizationMigrationRecordTable { /// diff --git a/util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.cs b/util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.cs new file mode 100644 index 000000000..10047c75f --- /dev/null +++ b/util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.cs @@ -0,0 +1,50 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Bit.MySqlMigrations.Migrations; + +/// +public partial class AddClientOrganizationMigrationRecordTable : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ClientOrganizationMigrationRecord", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrganizationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ProviderId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PlanType = table.Column(type: "tinyint unsigned", nullable: false), + Seats = table.Column(type: "int", nullable: false), + MaxStorageGb = table.Column(type: "smallint", nullable: true), + GatewayCustomerId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + GatewaySubscriptionId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExpirationDate = table.Column(type: "datetime(6)", nullable: true), + MaxAutoscaleSeats = table.Column(type: "int", nullable: true), + Status = table.Column(type: "tinyint unsigned", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ClientOrganizationMigrationRecord", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_ClientOrganizationMigrationRecord_ProviderId_OrganizationId", + table: "ClientOrganizationMigrationRecord", + columns: new[] { "ProviderId", "OrganizationId" }, + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ClientOrganizationMigrationRecord"); + } +} diff --git a/util/PostgresMigrations/Migrations/20241004140910_AddClientOrganizationMigrationRecordTable.cs b/util/PostgresMigrations/Migrations/20241004140910_AddClientOrganizationMigrationRecordTable.cs deleted file mode 100644 index 8649c129b..000000000 --- a/util/PostgresMigrations/Migrations/20241004140910_AddClientOrganizationMigrationRecordTable.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Bit.PostgresMigrations.Migrations -{ - /// - public partial class AddClientOrganizationMigrationRecordTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/util/PostgresMigrations/Migrations/20241004140910_AddClientOrganizationMigrationRecordTable.Designer.cs b/util/PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.Designer.cs similarity index 99% rename from util/PostgresMigrations/Migrations/20241004140910_AddClientOrganizationMigrationRecordTable.Designer.cs rename to util/PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.Designer.cs index 883286b98..252ad0bba 100644 --- a/util/PostgresMigrations/Migrations/20241004140910_AddClientOrganizationMigrationRecordTable.Designer.cs +++ b/util/PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.Designer.cs @@ -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 { /// diff --git a/util/PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.cs b/util/PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.cs new file mode 100644 index 000000000..b024dda2f --- /dev/null +++ b/util/PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.cs @@ -0,0 +1,47 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Bit.PostgresMigrations.Migrations; + +/// +public partial class AddClientOrganizationMigrationRecordTable : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ClientOrganizationMigrationRecord", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + OrganizationId = table.Column(type: "uuid", nullable: false), + ProviderId = table.Column(type: "uuid", nullable: false), + PlanType = table.Column(type: "smallint", nullable: false), + Seats = table.Column(type: "integer", nullable: false), + MaxStorageGb = table.Column(type: "smallint", nullable: true), + GatewayCustomerId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + GatewaySubscriptionId = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + ExpirationDate = table.Column(type: "timestamp with time zone", nullable: true), + MaxAutoscaleSeats = table.Column(type: "integer", nullable: true), + Status = table.Column(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); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ClientOrganizationMigrationRecord"); + } +} diff --git a/util/SqliteMigrations/Migrations/20241004140906_AddClientOrganizationMigrationRecordTable.cs b/util/SqliteMigrations/Migrations/20241004140906_AddClientOrganizationMigrationRecordTable.cs deleted file mode 100644 index 993250ad2..000000000 --- a/util/SqliteMigrations/Migrations/20241004140906_AddClientOrganizationMigrationRecordTable.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Bit.SqliteMigrations.Migrations -{ - /// - public partial class AddClientOrganizationMigrationRecordTable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/util/SqliteMigrations/Migrations/20241004140906_AddClientOrganizationMigrationRecordTable.Designer.cs b/util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.Designer.cs similarity index 99% rename from util/SqliteMigrations/Migrations/20241004140906_AddClientOrganizationMigrationRecordTable.Designer.cs rename to util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.Designer.cs index c5002ca47..588ed0741 100644 --- a/util/SqliteMigrations/Migrations/20241004140906_AddClientOrganizationMigrationRecordTable.Designer.cs +++ b/util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.Designer.cs @@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Bit.SqliteMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20241004140906_AddClientOrganizationMigrationRecordTable")] + [Migration("20241004154523_AddClientOrganizationMigrationRecordTable")] partial class AddClientOrganizationMigrationRecordTable { /// diff --git a/util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.cs b/util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.cs new file mode 100644 index 000000000..fce8ae17d --- /dev/null +++ b/util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.cs @@ -0,0 +1,47 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Bit.SqliteMigrations.Migrations; + +/// +public partial class AddClientOrganizationMigrationRecordTable : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ClientOrganizationMigrationRecord", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + OrganizationId = table.Column(type: "TEXT", nullable: false), + ProviderId = table.Column(type: "TEXT", nullable: false), + PlanType = table.Column(type: "INTEGER", nullable: false), + Seats = table.Column(type: "INTEGER", nullable: false), + MaxStorageGb = table.Column(type: "INTEGER", nullable: true), + GatewayCustomerId = table.Column(type: "TEXT", maxLength: 50, nullable: false), + GatewaySubscriptionId = table.Column(type: "TEXT", maxLength: 50, nullable: false), + ExpirationDate = table.Column(type: "TEXT", nullable: true), + MaxAutoscaleSeats = table.Column(type: "INTEGER", nullable: true), + Status = table.Column(type: "INTEGER", 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); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ClientOrganizationMigrationRecord"); + } +}