-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f391370
commit 310fafc
Showing
3 changed files
with
114 additions
and
120 deletions.
There are no files selected for viewing
82 changes: 40 additions & 42 deletions
82
util/MySqlMigrations/Migrations/20241004154527_AddClientOrganizationMigrationRecordTable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Bit.MySqlMigrations.Migrations | ||
namespace Bit.MySqlMigrations.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class AddClientOrganizationMigrationRecordTable : Migration | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddClientOrganizationMigrationRecordTable : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "ClientOrganizationMigrationRecord", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
ProviderId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
PlanType = table.Column<byte>(type: "tinyint unsigned", nullable: false), | ||
Seats = table.Column<int>(type: "int", nullable: false), | ||
MaxStorageGb = table.Column<short>(type: "smallint", nullable: true), | ||
GatewayCustomerId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) | ||
.Annotation("MySql:CharSet", "utf8mb4"), | ||
GatewaySubscriptionId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) | ||
.Annotation("MySql:CharSet", "utf8mb4"), | ||
ExpirationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true), | ||
MaxAutoscaleSeats = table.Column<int>(type: "int", nullable: true), | ||
Status = table.Column<byte>(type: "tinyint unsigned", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_ClientOrganizationMigrationRecord", x => x.Id); | ||
}) | ||
.Annotation("MySql:CharSet", "utf8mb4"); | ||
migrationBuilder.CreateTable( | ||
name: "ClientOrganizationMigrationRecord", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
ProviderId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), | ||
PlanType = table.Column<byte>(type: "tinyint unsigned", nullable: false), | ||
Seats = table.Column<int>(type: "int", nullable: false), | ||
MaxStorageGb = table.Column<short>(type: "smallint", nullable: true), | ||
GatewayCustomerId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) | ||
.Annotation("MySql:CharSet", "utf8mb4"), | ||
GatewaySubscriptionId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false) | ||
.Annotation("MySql:CharSet", "utf8mb4"), | ||
ExpirationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true), | ||
MaxAutoscaleSeats = table.Column<int>(type: "int", nullable: true), | ||
Status = table.Column<byte>(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); | ||
} | ||
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"); | ||
} | ||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "ClientOrganizationMigrationRecord"); | ||
} | ||
} |
76 changes: 37 additions & 39 deletions
76
...PostgresMigrations/Migrations/20241004154531_AddClientOrganizationMigrationRecordTable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Bit.PostgresMigrations.Migrations | ||
namespace Bit.PostgresMigrations.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class AddClientOrganizationMigrationRecordTable : Migration | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddClientOrganizationMigrationRecordTable : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
/// <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.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); | ||
} | ||
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"); | ||
} | ||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "ClientOrganizationMigrationRecord"); | ||
} | ||
} |
76 changes: 37 additions & 39 deletions
76
util/SqliteMigrations/Migrations/20241004154523_AddClientOrganizationMigrationRecordTable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Bit.SqliteMigrations.Migrations | ||
namespace Bit.SqliteMigrations.Migrations; | ||
|
||
/// <inheritdoc /> | ||
public partial class AddClientOrganizationMigrationRecordTable : Migration | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddClientOrganizationMigrationRecordTable : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "ClientOrganizationMigrationRecord", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "TEXT", nullable: false), | ||
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
ProviderId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
PlanType = table.Column<byte>(type: "INTEGER", nullable: false), | ||
Seats = table.Column<int>(type: "INTEGER", nullable: false), | ||
MaxStorageGb = table.Column<short>(type: "INTEGER", nullable: true), | ||
GatewayCustomerId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false), | ||
GatewaySubscriptionId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false), | ||
ExpirationDate = table.Column<DateTime>(type: "TEXT", nullable: true), | ||
MaxAutoscaleSeats = table.Column<int>(type: "INTEGER", nullable: true), | ||
Status = table.Column<byte>(type: "INTEGER", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_ClientOrganizationMigrationRecord", x => x.Id); | ||
}); | ||
migrationBuilder.CreateTable( | ||
name: "ClientOrganizationMigrationRecord", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(type: "TEXT", nullable: false), | ||
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
ProviderId = table.Column<Guid>(type: "TEXT", nullable: false), | ||
PlanType = table.Column<byte>(type: "INTEGER", nullable: false), | ||
Seats = table.Column<int>(type: "INTEGER", nullable: false), | ||
MaxStorageGb = table.Column<short>(type: "INTEGER", nullable: true), | ||
GatewayCustomerId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false), | ||
GatewaySubscriptionId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false), | ||
ExpirationDate = table.Column<DateTime>(type: "TEXT", nullable: true), | ||
MaxAutoscaleSeats = table.Column<int>(type: "INTEGER", nullable: true), | ||
Status = table.Column<byte>(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); | ||
} | ||
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"); | ||
} | ||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "ClientOrganizationMigrationRecord"); | ||
} | ||
} |