1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

[EC-343] Add Postgres EF migrations

This commit is contained in:
Rui Tome
2022-10-24 14:39:12 +01:00
parent 6bd89e691f
commit 8f1654cb7d
3 changed files with 2730 additions and 57 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,981 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations
{
public partial class UseCustomPermissionsFlag : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "User",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RenewalReminderDate",
table: "User",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "PremiumExpirationDate",
table: "User",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "LastFailedLoginDate",
table: "User",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "User",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "AccountRevisionDate",
table: "User",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Transaction",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "SsoUser",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "SsoConfig",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "SsoConfig",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Send",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ExpirationDate",
table: "Send",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "DeletionDate",
table: "Send",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Send",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "ProviderUser",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "ProviderUser",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "ProviderOrganization",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "ProviderOrganization",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Provider",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Provider",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Policy",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Policy",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "OrganizationUser",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "OrganizationUser",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ValidUntil",
table: "OrganizationSponsorship",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "LastSyncDate",
table: "OrganizationSponsorship",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "OrganizationApiKey",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Organization",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "OwnersNotifiedOfAutoscaling",
table: "Organization",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "ExpirationDate",
table: "Organization",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Organization",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<bool>(
name: "UseCustomPermissions",
table: "Organization",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Installation",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Group",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Group",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ExpirationDate",
table: "Grant",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Grant",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ConsumedDate",
table: "Grant",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Folder",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Folder",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Event",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "EmergencyAccess",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RecoveryInitiatedDate",
table: "EmergencyAccess",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "LastNotificationDate",
table: "EmergencyAccess",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "EmergencyAccess",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Device",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Device",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Collection",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Collection",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Cipher",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "DeletedDate",
table: "Cipher",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Cipher",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ResponseDate",
table: "AuthRequest",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RequestIpAddress",
table: "AuthRequest",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RequestDeviceIdentifier",
table: "AuthRequest",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "AuthRequest",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "AuthenticationDate",
table: "AuthRequest",
type: "timestamp without time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "AccessCode",
table: "AuthRequest",
type: "character varying(25)",
maxLength: 25,
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UseCustomPermissions",
table: "Organization");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "User",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RenewalReminderDate",
table: "User",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "PremiumExpirationDate",
table: "User",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "LastFailedLoginDate",
table: "User",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "User",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "AccountRevisionDate",
table: "User",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Transaction",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "SsoUser",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "SsoConfig",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "SsoConfig",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Send",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ExpirationDate",
table: "Send",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "DeletionDate",
table: "Send",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Send",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "ProviderUser",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "ProviderUser",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "ProviderOrganization",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "ProviderOrganization",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Provider",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Provider",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Policy",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Policy",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "OrganizationUser",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "OrganizationUser",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ValidUntil",
table: "OrganizationSponsorship",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "LastSyncDate",
table: "OrganizationSponsorship",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "OrganizationApiKey",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Organization",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "OwnersNotifiedOfAutoscaling",
table: "Organization",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "ExpirationDate",
table: "Organization",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Organization",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Installation",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Group",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Group",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ExpirationDate",
table: "Grant",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Grant",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ConsumedDate",
table: "Grant",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Folder",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Folder",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Event",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "EmergencyAccess",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RecoveryInitiatedDate",
table: "EmergencyAccess",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "LastNotificationDate",
table: "EmergencyAccess",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "EmergencyAccess",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Device",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Device",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Collection",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Collection",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "RevisionDate",
table: "Cipher",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "DeletedDate",
table: "Cipher",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "Cipher",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "ResponseDate",
table: "AuthRequest",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RequestIpAddress",
table: "AuthRequest",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RequestDeviceIdentifier",
table: "AuthRequest",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "CreationDate",
table: "AuthRequest",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "AuthenticationDate",
table: "AuthRequest",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "AccessCode",
table: "AuthRequest",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(25)",
oldMaxLength: 25,
oldNullable: true);
}
}
}

View File

@ -29,13 +29,14 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<string>("AccessCode")
.HasColumnType("text");
.HasMaxLength(25)
.HasColumnType("character varying(25)");
b.Property<DateTime?>("AuthenticationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Key")
.HasColumnType("text");
@ -47,7 +48,8 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<string>("RequestDeviceIdentifier")
.HasColumnType("text");
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<byte>("RequestDeviceType")
.HasColumnType("smallint");
@ -56,10 +58,11 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<string>("RequestIpAddress")
.HasColumnType("text");
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime?>("ResponseDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<Guid?>("ResponseDeviceId")
.HasColumnType("uuid");
@ -88,13 +91,13 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Data")
.HasColumnType("text");
b.Property<DateTime?>("DeletedDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Favorites")
.HasColumnType("text");
@ -109,7 +112,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("smallint");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Type")
.HasColumnType("smallint");
@ -132,7 +135,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("ExternalId")
.HasMaxLength(300)
@ -145,7 +148,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.HasKey("Id");
@ -223,7 +226,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Identifier")
.HasMaxLength(50)
@ -238,7 +241,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(255)");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Type")
.HasColumnType("smallint");
@ -259,7 +262,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Email")
.HasMaxLength(256)
@ -275,13 +278,13 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime?>("LastNotificationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<DateTime?>("RecoveryInitiatedDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Status")
.HasColumnType("smallint");
@ -316,7 +319,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte?>("DeviceType")
.HasColumnType("smallint");
@ -366,13 +369,13 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
@ -395,10 +398,10 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(200)");
b.Property<DateTime?>("ConsumedDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Data")
.HasColumnType("text");
@ -408,7 +411,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(200)");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("SessionId")
.HasMaxLength(100)
@ -436,7 +439,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("ExternalId")
.HasMaxLength(300)
@ -450,7 +453,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.HasKey("Id");
@ -485,7 +488,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Email")
.HasMaxLength(256)
@ -537,13 +540,13 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(30)");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte?>("Gateway")
.HasColumnType("smallint");
@ -579,7 +582,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(50)");
b.Property<DateTime?>("OwnersNotifiedOfAutoscaling")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Plan")
.HasMaxLength(50)
@ -598,7 +601,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<int?>("Seats")
.HasColumnType("integer");
@ -618,6 +621,9 @@ namespace Bit.PostgresMigrations.Migrations
b.Property<bool>("UseApi")
.HasColumnType("boolean");
b.Property<bool>("UseCustomPermissions")
.HasColumnType("boolean");
b.Property<bool>("UseDirectory")
.HasColumnType("boolean");
@ -666,7 +672,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Type")
.HasColumnType("smallint");
@ -712,7 +718,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(256)");
b.Property<DateTime?>("LastSyncDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("OfferedToEmail")
.HasMaxLength(256)
@ -734,7 +740,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<DateTime?>("ValidUntil")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.HasKey("Id");
@ -754,7 +760,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Email")
.HasMaxLength(256)
@ -777,7 +783,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<short>("Status")
.HasColumnType("smallint");
@ -803,7 +809,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Data")
.HasColumnType("text");
@ -815,7 +821,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Type")
.HasColumnType("smallint");
@ -854,7 +860,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<bool>("Enabled")
.HasColumnType("boolean");
@ -863,7 +869,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Status")
.HasColumnType("smallint");
@ -882,7 +888,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Key")
.HasColumnType("text");
@ -894,7 +900,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Settings")
.HasColumnType("text");
@ -914,7 +920,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Email")
.HasColumnType("text");
@ -929,7 +935,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Status")
.HasColumnType("smallint");
@ -958,19 +964,19 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("integer");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Data")
.HasColumnType("text");
b.Property<DateTime>("DeletionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<bool>("Disabled")
.HasColumnType("boolean");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<bool?>("HideEmail")
.HasColumnType("boolean");
@ -989,7 +995,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(300)");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<byte>("Type")
.HasColumnType("smallint");
@ -1015,7 +1021,7 @@ namespace Bit.PostgresMigrations.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Data")
.HasColumnType("text");
@ -1027,7 +1033,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.HasKey("Id");
@ -1045,7 +1051,7 @@ namespace Bit.PostgresMigrations.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("ExternalId")
.HasMaxLength(50)
@ -1105,7 +1111,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("numeric");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Details")
.HasMaxLength(100)
@ -1151,7 +1157,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("uuid");
b.Property<DateTime>("AccountRevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("ApiKey")
.IsRequired()
@ -1159,7 +1165,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("character varying(30)");
b.Property<DateTime>("CreationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("Culture")
.HasMaxLength(10)
@ -1207,7 +1213,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime?>("LastFailedLoginDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("LicenseKey")
.HasMaxLength(100)
@ -1232,7 +1238,7 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("boolean");
b.Property<DateTime?>("PremiumExpirationDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("PrivateKey")
.HasColumnType("text");
@ -1244,10 +1250,10 @@ namespace Bit.PostgresMigrations.Migrations
.HasColumnType("text");
b.Property<DateTime?>("RenewalReminderDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("RevisionDate")
.HasColumnType("timestamp with time zone");
.HasColumnType("timestamp without time zone");
b.Property<string>("SecurityStamp")
.IsRequired()