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( name: "RevisionDate", table: "User", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RenewalReminderDate", table: "User", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "PremiumExpirationDate", table: "User", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "LastFailedLoginDate", table: "User", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "User", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "AccountRevisionDate", table: "User", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Transaction", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "SsoUser", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "SsoConfig", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "SsoConfig", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Send", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "ExpirationDate", table: "Send", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "DeletionDate", table: "Send", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Send", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "ProviderUser", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "ProviderUser", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "ProviderOrganization", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "ProviderOrganization", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Provider", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Provider", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Policy", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Policy", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "OrganizationUser", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "OrganizationUser", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "ValidUntil", table: "OrganizationSponsorship", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "LastSyncDate", table: "OrganizationSponsorship", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "RevisionDate", table: "OrganizationApiKey", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Organization", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "OwnersNotifiedOfAutoscaling", table: "Organization", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "ExpirationDate", table: "Organization", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "Organization", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AddColumn( name: "UseCustomPermissions", table: "Organization", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AlterColumn( name: "CreationDate", table: "Installation", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Group", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Group", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "ExpirationDate", table: "Grant", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "Grant", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "ConsumedDate", table: "Grant", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Folder", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Folder", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "Date", table: "Event", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "EmergencyAccess", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RecoveryInitiatedDate", table: "EmergencyAccess", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "LastNotificationDate", table: "EmergencyAccess", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "EmergencyAccess", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Device", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Device", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Collection", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Collection", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Cipher", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "DeletedDate", table: "Cipher", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "Cipher", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "ResponseDate", table: "AuthRequest", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "RequestIpAddress", table: "AuthRequest", type: "character varying(50)", maxLength: 50, nullable: true, oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "RequestDeviceIdentifier", table: "AuthRequest", type: "character varying(50)", maxLength: 50, nullable: true, oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "AuthRequest", type: "timestamp without time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "AuthenticationDate", table: "AuthRequest", type: "timestamp without time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( 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( name: "RevisionDate", table: "User", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RenewalReminderDate", table: "User", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "PremiumExpirationDate", table: "User", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "LastFailedLoginDate", table: "User", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "User", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "AccountRevisionDate", table: "User", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Transaction", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "SsoUser", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "SsoConfig", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "SsoConfig", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Send", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "ExpirationDate", table: "Send", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "DeletionDate", table: "Send", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Send", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "ProviderUser", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "ProviderUser", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "ProviderOrganization", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "ProviderOrganization", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Provider", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Provider", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Policy", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Policy", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "OrganizationUser", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "OrganizationUser", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "ValidUntil", table: "OrganizationSponsorship", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "LastSyncDate", table: "OrganizationSponsorship", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "RevisionDate", table: "OrganizationApiKey", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Organization", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "OwnersNotifiedOfAutoscaling", table: "Organization", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "ExpirationDate", table: "Organization", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "Organization", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Installation", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Group", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Group", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "ExpirationDate", table: "Grant", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "Grant", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "ConsumedDate", table: "Grant", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Folder", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Folder", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "Date", table: "Event", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "EmergencyAccess", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RecoveryInitiatedDate", table: "EmergencyAccess", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "LastNotificationDate", table: "EmergencyAccess", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "EmergencyAccess", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Device", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Device", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Collection", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "CreationDate", table: "Collection", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "RevisionDate", table: "Cipher", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "DeletedDate", table: "Cipher", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "Cipher", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "ResponseDate", table: "AuthRequest", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "RequestIpAddress", table: "AuthRequest", type: "text", nullable: true, oldClrType: typeof(string), oldType: "character varying(50)", oldMaxLength: 50, oldNullable: true); migrationBuilder.AlterColumn( name: "RequestDeviceIdentifier", table: "AuthRequest", type: "text", nullable: true, oldClrType: typeof(string), oldType: "character varying(50)", oldMaxLength: 50, oldNullable: true); migrationBuilder.AlterColumn( name: "CreationDate", table: "AuthRequest", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp without time zone"); migrationBuilder.AlterColumn( name: "AuthenticationDate", table: "AuthRequest", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp without time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "AccessCode", table: "AuthRequest", type: "text", nullable: true, oldClrType: typeof(string), oldType: "character varying(25)", oldMaxLength: 25, oldNullable: true); } } }