1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-16 01:51:21 +01:00

[PM-2944] Update Null DB Constraints (#4459)

* Update Database Models

* Format
This commit is contained in:
Justin Baur 2024-07-03 16:21:25 -04:00 committed by GitHub
parent b2df2e82dd
commit 8d1f6a9f66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 9500 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,581 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
/// <inheritdoc />
public partial class UpdateNullConstraints : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "User",
keyColumn: "Culture",
keyValue: null,
column: "Culture",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Culture",
table: "User",
type: "varchar(10)",
maxLength: 10,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(10)",
oldMaxLength: 10,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "TaxRate",
keyColumn: "PostalCode",
keyValue: null,
column: "PostalCode",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PostalCode",
table: "TaxRate",
type: "varchar(10)",
maxLength: 10,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(10)",
oldMaxLength: 10,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "TaxRate",
keyColumn: "Country",
keyValue: null,
column: "Country",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "TaxRate",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ProviderInvoiceItem",
keyColumn: "PlanName",
keyValue: null,
column: "PlanName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ProviderInvoiceItem",
keyColumn: "InvoiceId",
keyValue: null,
column: "InvoiceId",
value: "");
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ProviderInvoiceItem",
keyColumn: "ClientName",
keyValue: null,
column: "ClientName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "OrganizationDomain",
keyColumn: "Txt",
keyValue: null,
column: "Txt",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Txt",
table: "OrganizationDomain",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "OrganizationDomain",
keyColumn: "DomainName",
keyValue: null,
column: "DomainName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "OrganizationDomain",
type: "varchar(255)",
maxLength: 255,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)",
oldMaxLength: 255,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "OrganizationApiKey",
keyColumn: "ApiKey",
keyValue: null,
column: "ApiKey",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ApiKey",
table: "OrganizationApiKey",
type: "varchar(30)",
maxLength: 30,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(30)",
oldMaxLength: 30,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Installation",
keyColumn: "Key",
keyValue: null,
column: "Key",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "Installation",
type: "varchar(150)",
maxLength: 150,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(150)",
oldMaxLength: 150,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Installation",
keyColumn: "Email",
keyValue: null,
column: "Email",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Installation",
type: "varchar(256)",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(256)",
oldMaxLength: 256,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Device",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Device",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Device",
keyColumn: "Identifier",
keyValue: null,
column: "Identifier",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Identifier",
table: "Device",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Collection",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Collection",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApiKey",
keyColumn: "Scope",
keyValue: null,
column: "Scope",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Scope",
table: "ApiKey",
type: "varchar(4000)",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(4000)",
oldMaxLength: 4000,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApiKey",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "ApiKey",
type: "varchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApiKey",
keyColumn: "Key",
keyValue: null,
column: "Key",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "ApiKey",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApiKey",
keyColumn: "EncryptedPayload",
keyValue: null,
column: "EncryptedPayload",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EncryptedPayload",
table: "ApiKey",
type: "varchar(4000)",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(4000)",
oldMaxLength: 4000,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Culture",
table: "User",
type: "varchar(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(10)",
oldMaxLength: 10)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PostalCode",
table: "TaxRate",
type: "varchar(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(10)",
oldMaxLength: 10)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "TaxRate",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Txt",
table: "OrganizationDomain",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "OrganizationDomain",
type: "varchar(255)",
maxLength: 255,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(255)",
oldMaxLength: 255)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ApiKey",
table: "OrganizationApiKey",
type: "varchar(30)",
maxLength: 30,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(30)",
oldMaxLength: 30)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "Installation",
type: "varchar(150)",
maxLength: 150,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(150)",
oldMaxLength: 150)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Installation",
type: "varchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(256)",
oldMaxLength: 256)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Device",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Identifier",
table: "Device",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Collection",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Scope",
table: "ApiKey",
type: "varchar(4000)",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(4000)",
oldMaxLength: 4000)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "ApiKey",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "ApiKey",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "EncryptedPayload",
table: "ApiKey",
type: "varchar(4000)",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(4000)",
oldMaxLength: 4000)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}

View File

@ -691,6 +691,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("int");
b.Property<string>("ClientName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
@ -698,6 +699,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("InvoiceId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
@ -706,6 +708,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("varchar(50)");
b.Property<string>("PlanName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
@ -795,6 +798,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("varchar(300)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("OrganizationId")
@ -892,10 +896,12 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("longtext");
b.Property<string>("Identifier")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
@ -1057,6 +1063,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)");
@ -1064,6 +1071,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("tinyint(1)");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("varchar(150)");
@ -1078,6 +1086,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("char(36)");
b.Property<string>("ApiKey")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)");
@ -1130,6 +1139,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("DomainName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)");
@ -1146,6 +1156,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("char(36)");
b.Property<string>("Txt")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime?>("VerifiedDate")
@ -1342,10 +1353,12 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("tinyint(1)");
b.Property<string>("Country")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("PostalCode")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
@ -1440,6 +1453,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("Culture")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
@ -1619,6 +1633,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("EncryptedPayload")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("varchar(4000)");
@ -1626,9 +1641,11 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
@ -1636,6 +1653,7 @@ namespace Bit.MySqlMigrations.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("Scope")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("varchar(4000)");

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,401 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class UpdateNullConstraints : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Culture",
table: "User",
type: "character varying(10)",
maxLength: 10,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(10)",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PostalCode",
table: "TaxRate",
type: "character varying(10)",
maxLength: 10,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(10)",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "TaxRate",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Txt",
table: "OrganizationDomain",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "OrganizationDomain",
type: "character varying(255)",
maxLength: 255,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ApiKey",
table: "OrganizationApiKey",
type: "character varying(30)",
maxLength: 30,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(30)",
oldMaxLength: 30,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "Installation",
type: "character varying(150)",
maxLength: 150,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(150)",
oldMaxLength: 150,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Installation",
type: "character varying(256)",
maxLength: 256,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Device",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Identifier",
table: "Device",
type: "character varying(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Collection",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Scope",
table: "ApiKey",
type: "character varying(4000)",
maxLength: 4000,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(4000)",
oldMaxLength: 4000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "ApiKey",
type: "character varying(200)",
maxLength: 200,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(200)",
oldMaxLength: 200,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "ApiKey",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "EncryptedPayload",
table: "ApiKey",
type: "character varying(4000)",
maxLength: 4000,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(4000)",
oldMaxLength: 4000,
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Culture",
table: "User",
type: "character varying(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(10)",
oldMaxLength: 10);
migrationBuilder.AlterColumn<string>(
name: "PostalCode",
table: "TaxRate",
type: "character varying(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(10)",
oldMaxLength: 10);
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "TaxRate",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Txt",
table: "OrganizationDomain",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "OrganizationDomain",
type: "character varying(255)",
maxLength: 255,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255);
migrationBuilder.AlterColumn<string>(
name: "ApiKey",
table: "OrganizationApiKey",
type: "character varying(30)",
maxLength: 30,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(30)",
oldMaxLength: 30);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "Installation",
type: "character varying(150)",
maxLength: 150,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(150)",
oldMaxLength: 150);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Installation",
type: "character varying(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Device",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Identifier",
table: "Device",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Collection",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Scope",
table: "ApiKey",
type: "character varying(4000)",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(4000)",
oldMaxLength: 4000);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "ApiKey",
type: "character varying(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "ApiKey",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "EncryptedPayload",
table: "ApiKey",
type: "character varying(4000)",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(4000)",
oldMaxLength: 4000);
}
}

View File

@ -696,6 +696,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("integer");
b.Property<string>("ClientName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
@ -703,6 +704,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("InvoiceId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
@ -711,6 +713,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(50)");
b.Property<string>("PlanName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
@ -800,6 +803,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(300)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("OrganizationId")
@ -897,10 +901,12 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<string>("Identifier")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
@ -1062,6 +1068,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
@ -1069,6 +1076,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
@ -1083,6 +1091,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<string>("ApiKey")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
@ -1135,6 +1144,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("DomainName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
@ -1151,6 +1161,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<string>("Txt")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime?>("VerifiedDate")
@ -1348,10 +1359,12 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<string>("Country")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("PostalCode")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
@ -1446,6 +1459,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("Culture")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
@ -1626,6 +1640,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("EncryptedPayload")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("character varying(4000)");
@ -1633,9 +1648,11 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("character varying(200)");
@ -1643,6 +1660,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("timestamp with time zone");
b.Property<string>("Scope")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("character varying(4000)");

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,401 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.SqliteMigrations.Migrations;
/// <inheritdoc />
public partial class UpdateNullConstraints : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Culture",
table: "User",
type: "TEXT",
maxLength: 10,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PostalCode",
table: "TaxRate",
type: "TEXT",
maxLength: 10,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "TaxRate",
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Txt",
table: "OrganizationDomain",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "OrganizationDomain",
type: "TEXT",
maxLength: 255,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 255,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ApiKey",
table: "OrganizationApiKey",
type: "TEXT",
maxLength: 30,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 30,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "Installation",
type: "TEXT",
maxLength: 150,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 150,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Installation",
type: "TEXT",
maxLength: 256,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Device",
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Identifier",
table: "Device",
type: "TEXT",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Collection",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Scope",
table: "ApiKey",
type: "TEXT",
maxLength: 4000,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 4000,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "ApiKey",
type: "TEXT",
maxLength: 200,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 200,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "ApiKey",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "EncryptedPayload",
table: "ApiKey",
type: "TEXT",
maxLength: 4000,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 4000,
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Culture",
table: "User",
type: "TEXT",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 10);
migrationBuilder.AlterColumn<string>(
name: "PostalCode",
table: "TaxRate",
type: "TEXT",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 10);
migrationBuilder.AlterColumn<string>(
name: "Country",
table: "TaxRate",
type: "TEXT",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "PlanName",
table: "ProviderInvoiceItem",
type: "TEXT",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "InvoiceId",
table: "ProviderInvoiceItem",
type: "TEXT",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "ClientName",
table: "ProviderInvoiceItem",
type: "TEXT",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Txt",
table: "OrganizationDomain",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "OrganizationDomain",
type: "TEXT",
maxLength: 255,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 255);
migrationBuilder.AlterColumn<string>(
name: "ApiKey",
table: "OrganizationApiKey",
type: "TEXT",
maxLength: 30,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 30);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "Installation",
type: "TEXT",
maxLength: 150,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 150);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "Installation",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Device",
type: "TEXT",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Identifier",
table: "Device",
type: "TEXT",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Collection",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "Scope",
table: "ApiKey",
type: "TEXT",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 4000);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "ApiKey",
type: "TEXT",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 200);
migrationBuilder.AlterColumn<string>(
name: "Key",
table: "ApiKey",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "EncryptedPayload",
table: "ApiKey",
type: "TEXT",
maxLength: 4000,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 4000);
}
}

View File

@ -680,6 +680,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("INTEGER");
b.Property<string>("ClientName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
@ -687,6 +688,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("InvoiceId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
@ -695,6 +697,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("PlanName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
@ -784,6 +787,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("OrganizationId")
@ -881,10 +885,12 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Identifier")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
@ -1046,6 +1052,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
@ -1053,6 +1060,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("INTEGER");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("TEXT");
@ -1067,6 +1075,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("ApiKey")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("TEXT");
@ -1119,6 +1128,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("DomainName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
@ -1135,6 +1145,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Txt")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime?>("VerifiedDate")
@ -1331,10 +1342,12 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("INTEGER");
b.Property<string>("Country")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("PostalCode")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
@ -1429,6 +1442,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Culture")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
@ -1608,6 +1622,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("EncryptedPayload")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("TEXT");
@ -1615,9 +1630,11 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Key")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
@ -1625,6 +1642,7 @@ namespace Bit.SqliteMigrations.Migrations
.HasColumnType("TEXT");
b.Property<string>("Scope")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("TEXT");