mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[PM-2944] Update Null DB Constraints (#4459)
* Update Database Models * Format
This commit is contained in:
2678
util/SqliteMigrations/Migrations/20240703192739_UpdateNullConstraints.Designer.cs
generated
Normal file
2678
util/SqliteMigrations/Migrations/20240703192739_UpdateNullConstraints.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
}
|
||||
}
|
@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user