From a24465b137e36943595dde38cf6927a7b8567bda Mon Sep 17 00:00:00 2001 From: Rui Tome Date: Fri, 16 Feb 2024 14:43:12 +0000 Subject: [PATCH] [AC-1682] Bumped up dates on EF migrations --- ...8_FCAccessAllCollectionGroups.Designer.cs} | 23 +++++++++++++----- ...0216131258_FCAccessAllCollectionGroups.cs} | 0 ...32_FCAccessAllCollectionUsers.Designer.cs} | 23 +++++++++++++----- ...40216131332_FCAccessAllCollectionUsers.cs} | 0 ...rsEditAssignedCollectionUsers.Designer.cs} | 23 +++++++++++++----- ..._FCManagersEditAssignedCollectionUsers.cs} | 0 ...EnableOrgsFlexibleCollections.Designer.cs} | 23 +++++++++++++----- ...131550_FCEnableOrgsFlexibleCollections.cs} | 0 ...3_FCAccessAllCollectionGroups.Designer.cs} | 24 ++++++++++++++----- ...0216131303_FCAccessAllCollectionGroups.cs} | 0 ...36_FCAccessAllCollectionUsers.Designer.cs} | 24 ++++++++++++++----- ...40216131336_FCAccessAllCollectionUsers.cs} | 0 ...rsEditAssignedCollectionUsers.Designer.cs} | 24 ++++++++++++++----- ..._FCManagersEditAssignedCollectionUsers.cs} | 0 ...EnableOrgsFlexibleCollections.Designer.cs} | 24 ++++++++++++++----- ...131554_FCEnableOrgsFlexibleCollections.cs} | 0 ...7_FCAccessAllCollectionGroups.Designer.cs} | 23 +++++++++++++----- ...0216131307_FCAccessAllCollectionGroups.cs} | 0 ...27_FCAccessAllCollectionUsers.Designer.cs} | 23 +++++++++++++----- ...40216131327_FCAccessAllCollectionUsers.cs} | 0 ...rsEditAssignedCollectionUsers.Designer.cs} | 23 +++++++++++++----- ..._FCManagersEditAssignedCollectionUsers.cs} | 0 ...EnableOrgsFlexibleCollections.Designer.cs} | 23 +++++++++++++----- ...131546_FCEnableOrgsFlexibleCollections.cs} | 0 24 files changed, 208 insertions(+), 72 deletions(-) rename util/MySqlMigrations/Migrations/{20240112123253_FCAccessAllCollectionGroups.Designer.cs => 20240216131258_FCAccessAllCollectionGroups.Designer.cs} (99%) rename util/MySqlMigrations/Migrations/{20240112123253_FCAccessAllCollectionGroups.cs => 20240216131258_FCAccessAllCollectionGroups.cs} (100%) rename util/MySqlMigrations/Migrations/{20240112123310_FCAccessAllCollectionUsers.Designer.cs => 20240216131332_FCAccessAllCollectionUsers.Designer.cs} (99%) rename util/MySqlMigrations/Migrations/{20240112123310_FCAccessAllCollectionUsers.cs => 20240216131332_FCAccessAllCollectionUsers.cs} (100%) rename util/MySqlMigrations/Migrations/{20240112123340_FCManagersEditAssignedCollectionUsers.Designer.cs => 20240216131454_FCManagersEditAssignedCollectionUsers.Designer.cs} (99%) rename util/MySqlMigrations/Migrations/{20240112123340_FCManagersEditAssignedCollectionUsers.cs => 20240216131454_FCManagersEditAssignedCollectionUsers.cs} (100%) rename util/MySqlMigrations/Migrations/{20240112123440_FCEnableOrgsFlexibleCollections.Designer.cs => 20240216131550_FCEnableOrgsFlexibleCollections.Designer.cs} (99%) rename util/MySqlMigrations/Migrations/{20240112123440_FCEnableOrgsFlexibleCollections.cs => 20240216131550_FCEnableOrgsFlexibleCollections.cs} (100%) rename util/PostgresMigrations/Migrations/{20240112123257_FCAccessAllCollectionGroups.Designer.cs => 20240216131303_FCAccessAllCollectionGroups.Designer.cs} (99%) rename util/PostgresMigrations/Migrations/{20240112123257_FCAccessAllCollectionGroups.cs => 20240216131303_FCAccessAllCollectionGroups.cs} (100%) rename util/PostgresMigrations/Migrations/{20240112123314_FCAccessAllCollectionUsers.Designer.cs => 20240216131336_FCAccessAllCollectionUsers.Designer.cs} (99%) rename util/PostgresMigrations/Migrations/{20240112123314_FCAccessAllCollectionUsers.cs => 20240216131336_FCAccessAllCollectionUsers.cs} (100%) rename util/PostgresMigrations/Migrations/{20240112123331_FCManagersEditAssignedCollectionUsers.Designer.cs => 20240216131450_FCManagersEditAssignedCollectionUsers.Designer.cs} (99%) rename util/PostgresMigrations/Migrations/{20240112123331_FCManagersEditAssignedCollectionUsers.cs => 20240216131450_FCManagersEditAssignedCollectionUsers.cs} (100%) rename util/PostgresMigrations/Migrations/{20240112123436_FCEnableOrgsFlexibleCollections.Designer.cs => 20240216131554_FCEnableOrgsFlexibleCollections.Designer.cs} (99%) rename util/PostgresMigrations/Migrations/{20240112123436_FCEnableOrgsFlexibleCollections.cs => 20240216131554_FCEnableOrgsFlexibleCollections.cs} (100%) rename util/SqliteMigrations/Migrations/{20240112123248_FCAccessAllCollectionGroups.Designer.cs => 20240216131307_FCAccessAllCollectionGroups.Designer.cs} (99%) rename util/SqliteMigrations/Migrations/{20240112123248_FCAccessAllCollectionGroups.cs => 20240216131307_FCAccessAllCollectionGroups.cs} (100%) rename util/SqliteMigrations/Migrations/{20240112123318_FCAccessAllCollectionUsers.Designer.cs => 20240216131327_FCAccessAllCollectionUsers.Designer.cs} (99%) rename util/SqliteMigrations/Migrations/{20240112123318_FCAccessAllCollectionUsers.cs => 20240216131327_FCAccessAllCollectionUsers.cs} (100%) rename util/SqliteMigrations/Migrations/{20240112123335_FCManagersEditAssignedCollectionUsers.Designer.cs => 20240216131445_FCManagersEditAssignedCollectionUsers.Designer.cs} (99%) rename util/SqliteMigrations/Migrations/{20240112123335_FCManagersEditAssignedCollectionUsers.cs => 20240216131445_FCManagersEditAssignedCollectionUsers.cs} (100%) rename util/SqliteMigrations/Migrations/{20240112123445_FCEnableOrgsFlexibleCollections.Designer.cs => 20240216131546_FCEnableOrgsFlexibleCollections.Designer.cs} (99%) rename util/SqliteMigrations/Migrations/{20240112123445_FCEnableOrgsFlexibleCollections.cs => 20240216131546_FCEnableOrgsFlexibleCollections.cs} (100%) diff --git a/util/MySqlMigrations/Migrations/20240112123253_FCAccessAllCollectionGroups.Designer.cs b/util/MySqlMigrations/Migrations/20240216131258_FCAccessAllCollectionGroups.Designer.cs similarity index 99% rename from util/MySqlMigrations/Migrations/20240112123253_FCAccessAllCollectionGroups.Designer.cs rename to util/MySqlMigrations/Migrations/20240216131258_FCAccessAllCollectionGroups.Designer.cs index d5ad94cc78..a7f0e19b63 100644 --- a/util/MySqlMigrations/Migrations/20240112123253_FCAccessAllCollectionGroups.Designer.cs +++ b/util/MySqlMigrations/Migrations/20240216131258_FCAccessAllCollectionGroups.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.MySqlMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123253_FCAccessAllCollectionGroups")] + [Migration("20240216131258_FCAccessAllCollectionGroups")] partial class FCAccessAllCollectionGroups { /// @@ -20,7 +20,7 @@ namespace Bit.MySqlMigrations.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => @@ -139,9 +139,6 @@ namespace Bit.MySqlMigrations.Migrations b.Property("Seats") .HasColumnType("int"); - b.Property("SecretsManagerBeta") - .HasColumnType("tinyint(1)"); - b.Property("SelfHost") .HasColumnType("tinyint(1)"); @@ -536,8 +533,12 @@ namespace Bit.MySqlMigrations.Migrations .HasColumnType("varchar(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -593,10 +594,20 @@ namespace Bit.MySqlMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/MySqlMigrations/Migrations/20240112123253_FCAccessAllCollectionGroups.cs b/util/MySqlMigrations/Migrations/20240216131258_FCAccessAllCollectionGroups.cs similarity index 100% rename from util/MySqlMigrations/Migrations/20240112123253_FCAccessAllCollectionGroups.cs rename to util/MySqlMigrations/Migrations/20240216131258_FCAccessAllCollectionGroups.cs diff --git a/util/MySqlMigrations/Migrations/20240112123310_FCAccessAllCollectionUsers.Designer.cs b/util/MySqlMigrations/Migrations/20240216131332_FCAccessAllCollectionUsers.Designer.cs similarity index 99% rename from util/MySqlMigrations/Migrations/20240112123310_FCAccessAllCollectionUsers.Designer.cs rename to util/MySqlMigrations/Migrations/20240216131332_FCAccessAllCollectionUsers.Designer.cs index 8e269605cf..c6764267ff 100644 --- a/util/MySqlMigrations/Migrations/20240112123310_FCAccessAllCollectionUsers.Designer.cs +++ b/util/MySqlMigrations/Migrations/20240216131332_FCAccessAllCollectionUsers.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.MySqlMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123310_FCAccessAllCollectionUsers")] + [Migration("20240216131332_FCAccessAllCollectionUsers")] partial class FCAccessAllCollectionUsers { /// @@ -20,7 +20,7 @@ namespace Bit.MySqlMigrations.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => @@ -139,9 +139,6 @@ namespace Bit.MySqlMigrations.Migrations b.Property("Seats") .HasColumnType("int"); - b.Property("SecretsManagerBeta") - .HasColumnType("tinyint(1)"); - b.Property("SelfHost") .HasColumnType("tinyint(1)"); @@ -536,8 +533,12 @@ namespace Bit.MySqlMigrations.Migrations .HasColumnType("varchar(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -593,10 +594,20 @@ namespace Bit.MySqlMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/MySqlMigrations/Migrations/20240112123310_FCAccessAllCollectionUsers.cs b/util/MySqlMigrations/Migrations/20240216131332_FCAccessAllCollectionUsers.cs similarity index 100% rename from util/MySqlMigrations/Migrations/20240112123310_FCAccessAllCollectionUsers.cs rename to util/MySqlMigrations/Migrations/20240216131332_FCAccessAllCollectionUsers.cs diff --git a/util/MySqlMigrations/Migrations/20240112123340_FCManagersEditAssignedCollectionUsers.Designer.cs b/util/MySqlMigrations/Migrations/20240216131454_FCManagersEditAssignedCollectionUsers.Designer.cs similarity index 99% rename from util/MySqlMigrations/Migrations/20240112123340_FCManagersEditAssignedCollectionUsers.Designer.cs rename to util/MySqlMigrations/Migrations/20240216131454_FCManagersEditAssignedCollectionUsers.Designer.cs index 03442c205b..1e96388183 100644 --- a/util/MySqlMigrations/Migrations/20240112123340_FCManagersEditAssignedCollectionUsers.Designer.cs +++ b/util/MySqlMigrations/Migrations/20240216131454_FCManagersEditAssignedCollectionUsers.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.MySqlMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123340_FCManagersEditAssignedCollectionUsers")] + [Migration("20240216131454_FCManagersEditAssignedCollectionUsers")] partial class FCManagersEditAssignedCollectionUsers { /// @@ -20,7 +20,7 @@ namespace Bit.MySqlMigrations.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => @@ -139,9 +139,6 @@ namespace Bit.MySqlMigrations.Migrations b.Property("Seats") .HasColumnType("int"); - b.Property("SecretsManagerBeta") - .HasColumnType("tinyint(1)"); - b.Property("SelfHost") .HasColumnType("tinyint(1)"); @@ -536,8 +533,12 @@ namespace Bit.MySqlMigrations.Migrations .HasColumnType("varchar(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -593,10 +594,20 @@ namespace Bit.MySqlMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/MySqlMigrations/Migrations/20240112123340_FCManagersEditAssignedCollectionUsers.cs b/util/MySqlMigrations/Migrations/20240216131454_FCManagersEditAssignedCollectionUsers.cs similarity index 100% rename from util/MySqlMigrations/Migrations/20240112123340_FCManagersEditAssignedCollectionUsers.cs rename to util/MySqlMigrations/Migrations/20240216131454_FCManagersEditAssignedCollectionUsers.cs diff --git a/util/MySqlMigrations/Migrations/20240112123440_FCEnableOrgsFlexibleCollections.Designer.cs b/util/MySqlMigrations/Migrations/20240216131550_FCEnableOrgsFlexibleCollections.Designer.cs similarity index 99% rename from util/MySqlMigrations/Migrations/20240112123440_FCEnableOrgsFlexibleCollections.Designer.cs rename to util/MySqlMigrations/Migrations/20240216131550_FCEnableOrgsFlexibleCollections.Designer.cs index 285b5a5e7a..35a9262a33 100644 --- a/util/MySqlMigrations/Migrations/20240112123440_FCEnableOrgsFlexibleCollections.Designer.cs +++ b/util/MySqlMigrations/Migrations/20240216131550_FCEnableOrgsFlexibleCollections.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.MySqlMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123440_FCEnableOrgsFlexibleCollections")] + [Migration("20240216131550_FCEnableOrgsFlexibleCollections")] partial class FCEnableOrgsFlexibleCollections { /// @@ -20,7 +20,7 @@ namespace Bit.MySqlMigrations.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => @@ -139,9 +139,6 @@ namespace Bit.MySqlMigrations.Migrations b.Property("Seats") .HasColumnType("int"); - b.Property("SecretsManagerBeta") - .HasColumnType("tinyint(1)"); - b.Property("SelfHost") .HasColumnType("tinyint(1)"); @@ -536,8 +533,12 @@ namespace Bit.MySqlMigrations.Migrations .HasColumnType("varchar(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -593,10 +594,20 @@ namespace Bit.MySqlMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/MySqlMigrations/Migrations/20240112123440_FCEnableOrgsFlexibleCollections.cs b/util/MySqlMigrations/Migrations/20240216131550_FCEnableOrgsFlexibleCollections.cs similarity index 100% rename from util/MySqlMigrations/Migrations/20240112123440_FCEnableOrgsFlexibleCollections.cs rename to util/MySqlMigrations/Migrations/20240216131550_FCEnableOrgsFlexibleCollections.cs diff --git a/util/PostgresMigrations/Migrations/20240112123257_FCAccessAllCollectionGroups.Designer.cs b/util/PostgresMigrations/Migrations/20240216131303_FCAccessAllCollectionGroups.Designer.cs similarity index 99% rename from util/PostgresMigrations/Migrations/20240112123257_FCAccessAllCollectionGroups.Designer.cs rename to util/PostgresMigrations/Migrations/20240216131303_FCAccessAllCollectionGroups.Designer.cs index feddf4f2fa..fc0cbacb69 100644 --- a/util/PostgresMigrations/Migrations/20240112123257_FCAccessAllCollectionGroups.Designer.cs +++ b/util/PostgresMigrations/Migrations/20240216131303_FCAccessAllCollectionGroups.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.PostgresMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123257_FCAccessAllCollectionGroups")] + [Migration("20240216131303_FCAccessAllCollectionGroups")] partial class FCAccessAllCollectionGroups { /// @@ -21,7 +21,7 @@ namespace Bit.PostgresMigrations.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False") - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -143,9 +143,6 @@ namespace Bit.PostgresMigrations.Migrations b.Property("Seats") .HasColumnType("integer"); - b.Property("SecretsManagerBeta") - .HasColumnType("boolean"); - b.Property("SelfHost") .HasColumnType("boolean"); @@ -542,8 +539,12 @@ namespace Bit.PostgresMigrations.Migrations .HasColumnType("character varying(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -604,10 +605,21 @@ namespace Bit.PostgresMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + + NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("OrganizationId", "ExternalId"), new[] { "UserId" }); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/PostgresMigrations/Migrations/20240112123257_FCAccessAllCollectionGroups.cs b/util/PostgresMigrations/Migrations/20240216131303_FCAccessAllCollectionGroups.cs similarity index 100% rename from util/PostgresMigrations/Migrations/20240112123257_FCAccessAllCollectionGroups.cs rename to util/PostgresMigrations/Migrations/20240216131303_FCAccessAllCollectionGroups.cs diff --git a/util/PostgresMigrations/Migrations/20240112123314_FCAccessAllCollectionUsers.Designer.cs b/util/PostgresMigrations/Migrations/20240216131336_FCAccessAllCollectionUsers.Designer.cs similarity index 99% rename from util/PostgresMigrations/Migrations/20240112123314_FCAccessAllCollectionUsers.Designer.cs rename to util/PostgresMigrations/Migrations/20240216131336_FCAccessAllCollectionUsers.Designer.cs index dece49f113..490beb8d0d 100644 --- a/util/PostgresMigrations/Migrations/20240112123314_FCAccessAllCollectionUsers.Designer.cs +++ b/util/PostgresMigrations/Migrations/20240216131336_FCAccessAllCollectionUsers.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.PostgresMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123314_FCAccessAllCollectionUsers")] + [Migration("20240216131336_FCAccessAllCollectionUsers")] partial class FCAccessAllCollectionUsers { /// @@ -21,7 +21,7 @@ namespace Bit.PostgresMigrations.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False") - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -143,9 +143,6 @@ namespace Bit.PostgresMigrations.Migrations b.Property("Seats") .HasColumnType("integer"); - b.Property("SecretsManagerBeta") - .HasColumnType("boolean"); - b.Property("SelfHost") .HasColumnType("boolean"); @@ -542,8 +539,12 @@ namespace Bit.PostgresMigrations.Migrations .HasColumnType("character varying(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -604,10 +605,21 @@ namespace Bit.PostgresMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + + NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("OrganizationId", "ExternalId"), new[] { "UserId" }); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/PostgresMigrations/Migrations/20240112123314_FCAccessAllCollectionUsers.cs b/util/PostgresMigrations/Migrations/20240216131336_FCAccessAllCollectionUsers.cs similarity index 100% rename from util/PostgresMigrations/Migrations/20240112123314_FCAccessAllCollectionUsers.cs rename to util/PostgresMigrations/Migrations/20240216131336_FCAccessAllCollectionUsers.cs diff --git a/util/PostgresMigrations/Migrations/20240112123331_FCManagersEditAssignedCollectionUsers.Designer.cs b/util/PostgresMigrations/Migrations/20240216131450_FCManagersEditAssignedCollectionUsers.Designer.cs similarity index 99% rename from util/PostgresMigrations/Migrations/20240112123331_FCManagersEditAssignedCollectionUsers.Designer.cs rename to util/PostgresMigrations/Migrations/20240216131450_FCManagersEditAssignedCollectionUsers.Designer.cs index 4ccfc57c29..b586e71de1 100644 --- a/util/PostgresMigrations/Migrations/20240112123331_FCManagersEditAssignedCollectionUsers.Designer.cs +++ b/util/PostgresMigrations/Migrations/20240216131450_FCManagersEditAssignedCollectionUsers.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.PostgresMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123331_FCManagersEditAssignedCollectionUsers")] + [Migration("20240216131450_FCManagersEditAssignedCollectionUsers")] partial class FCManagersEditAssignedCollectionUsers { /// @@ -21,7 +21,7 @@ namespace Bit.PostgresMigrations.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False") - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -143,9 +143,6 @@ namespace Bit.PostgresMigrations.Migrations b.Property("Seats") .HasColumnType("integer"); - b.Property("SecretsManagerBeta") - .HasColumnType("boolean"); - b.Property("SelfHost") .HasColumnType("boolean"); @@ -542,8 +539,12 @@ namespace Bit.PostgresMigrations.Migrations .HasColumnType("character varying(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -604,10 +605,21 @@ namespace Bit.PostgresMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + + NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("OrganizationId", "ExternalId"), new[] { "UserId" }); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/PostgresMigrations/Migrations/20240112123331_FCManagersEditAssignedCollectionUsers.cs b/util/PostgresMigrations/Migrations/20240216131450_FCManagersEditAssignedCollectionUsers.cs similarity index 100% rename from util/PostgresMigrations/Migrations/20240112123331_FCManagersEditAssignedCollectionUsers.cs rename to util/PostgresMigrations/Migrations/20240216131450_FCManagersEditAssignedCollectionUsers.cs diff --git a/util/PostgresMigrations/Migrations/20240112123436_FCEnableOrgsFlexibleCollections.Designer.cs b/util/PostgresMigrations/Migrations/20240216131554_FCEnableOrgsFlexibleCollections.Designer.cs similarity index 99% rename from util/PostgresMigrations/Migrations/20240112123436_FCEnableOrgsFlexibleCollections.Designer.cs rename to util/PostgresMigrations/Migrations/20240216131554_FCEnableOrgsFlexibleCollections.Designer.cs index b1b5ce166c..97e7b5f859 100644 --- a/util/PostgresMigrations/Migrations/20240112123436_FCEnableOrgsFlexibleCollections.Designer.cs +++ b/util/PostgresMigrations/Migrations/20240216131554_FCEnableOrgsFlexibleCollections.Designer.cs @@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.PostgresMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123436_FCEnableOrgsFlexibleCollections")] + [Migration("20240216131554_FCEnableOrgsFlexibleCollections")] partial class FCEnableOrgsFlexibleCollections { /// @@ -21,7 +21,7 @@ namespace Bit.PostgresMigrations.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False") - .HasAnnotation("ProductVersion", "7.0.14") + .HasAnnotation("ProductVersion", "7.0.15") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -143,9 +143,6 @@ namespace Bit.PostgresMigrations.Migrations b.Property("Seats") .HasColumnType("integer"); - b.Property("SecretsManagerBeta") - .HasColumnType("boolean"); - b.Property("SelfHost") .HasColumnType("boolean"); @@ -542,8 +539,12 @@ namespace Bit.PostgresMigrations.Migrations .HasColumnType("character varying(50)"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -604,10 +605,21 @@ namespace Bit.PostgresMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + + NpgsqlIndexBuilderExtensions.IncludeProperties(b.HasIndex("OrganizationId", "ExternalId"), new[] { "UserId" }); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/PostgresMigrations/Migrations/20240112123436_FCEnableOrgsFlexibleCollections.cs b/util/PostgresMigrations/Migrations/20240216131554_FCEnableOrgsFlexibleCollections.cs similarity index 100% rename from util/PostgresMigrations/Migrations/20240112123436_FCEnableOrgsFlexibleCollections.cs rename to util/PostgresMigrations/Migrations/20240216131554_FCEnableOrgsFlexibleCollections.cs diff --git a/util/SqliteMigrations/Migrations/20240112123248_FCAccessAllCollectionGroups.Designer.cs b/util/SqliteMigrations/Migrations/20240216131307_FCAccessAllCollectionGroups.Designer.cs similarity index 99% rename from util/SqliteMigrations/Migrations/20240112123248_FCAccessAllCollectionGroups.Designer.cs rename to util/SqliteMigrations/Migrations/20240216131307_FCAccessAllCollectionGroups.Designer.cs index ba92a34716..990b078583 100644 --- a/util/SqliteMigrations/Migrations/20240112123248_FCAccessAllCollectionGroups.Designer.cs +++ b/util/SqliteMigrations/Migrations/20240216131307_FCAccessAllCollectionGroups.Designer.cs @@ -12,14 +12,14 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.SqliteMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123248_FCAccessAllCollectionGroups")] + [Migration("20240216131307_FCAccessAllCollectionGroups")] partial class FCAccessAllCollectionGroups { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); + modelBuilder.HasAnnotation("ProductVersion", "7.0.15"); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => { @@ -137,9 +137,6 @@ namespace Bit.SqliteMigrations.Migrations b.Property("Seats") .HasColumnType("INTEGER"); - b.Property("SecretsManagerBeta") - .HasColumnType("INTEGER"); - b.Property("SelfHost") .HasColumnType("INTEGER"); @@ -534,8 +531,12 @@ namespace Bit.SqliteMigrations.Migrations .HasColumnType("TEXT"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -591,10 +592,20 @@ namespace Bit.SqliteMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/SqliteMigrations/Migrations/20240112123248_FCAccessAllCollectionGroups.cs b/util/SqliteMigrations/Migrations/20240216131307_FCAccessAllCollectionGroups.cs similarity index 100% rename from util/SqliteMigrations/Migrations/20240112123248_FCAccessAllCollectionGroups.cs rename to util/SqliteMigrations/Migrations/20240216131307_FCAccessAllCollectionGroups.cs diff --git a/util/SqliteMigrations/Migrations/20240112123318_FCAccessAllCollectionUsers.Designer.cs b/util/SqliteMigrations/Migrations/20240216131327_FCAccessAllCollectionUsers.Designer.cs similarity index 99% rename from util/SqliteMigrations/Migrations/20240112123318_FCAccessAllCollectionUsers.Designer.cs rename to util/SqliteMigrations/Migrations/20240216131327_FCAccessAllCollectionUsers.Designer.cs index 155d03157a..891acba9fe 100644 --- a/util/SqliteMigrations/Migrations/20240112123318_FCAccessAllCollectionUsers.Designer.cs +++ b/util/SqliteMigrations/Migrations/20240216131327_FCAccessAllCollectionUsers.Designer.cs @@ -12,14 +12,14 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.SqliteMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123318_FCAccessAllCollectionUsers")] + [Migration("20240216131327_FCAccessAllCollectionUsers")] partial class FCAccessAllCollectionUsers { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); + modelBuilder.HasAnnotation("ProductVersion", "7.0.15"); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => { @@ -137,9 +137,6 @@ namespace Bit.SqliteMigrations.Migrations b.Property("Seats") .HasColumnType("INTEGER"); - b.Property("SecretsManagerBeta") - .HasColumnType("INTEGER"); - b.Property("SelfHost") .HasColumnType("INTEGER"); @@ -534,8 +531,12 @@ namespace Bit.SqliteMigrations.Migrations .HasColumnType("TEXT"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -591,10 +592,20 @@ namespace Bit.SqliteMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/SqliteMigrations/Migrations/20240112123318_FCAccessAllCollectionUsers.cs b/util/SqliteMigrations/Migrations/20240216131327_FCAccessAllCollectionUsers.cs similarity index 100% rename from util/SqliteMigrations/Migrations/20240112123318_FCAccessAllCollectionUsers.cs rename to util/SqliteMigrations/Migrations/20240216131327_FCAccessAllCollectionUsers.cs diff --git a/util/SqliteMigrations/Migrations/20240112123335_FCManagersEditAssignedCollectionUsers.Designer.cs b/util/SqliteMigrations/Migrations/20240216131445_FCManagersEditAssignedCollectionUsers.Designer.cs similarity index 99% rename from util/SqliteMigrations/Migrations/20240112123335_FCManagersEditAssignedCollectionUsers.Designer.cs rename to util/SqliteMigrations/Migrations/20240216131445_FCManagersEditAssignedCollectionUsers.Designer.cs index 01df140b88..94c613acea 100644 --- a/util/SqliteMigrations/Migrations/20240112123335_FCManagersEditAssignedCollectionUsers.Designer.cs +++ b/util/SqliteMigrations/Migrations/20240216131445_FCManagersEditAssignedCollectionUsers.Designer.cs @@ -12,14 +12,14 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.SqliteMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123335_FCManagersEditAssignedCollectionUsers")] + [Migration("20240216131445_FCManagersEditAssignedCollectionUsers")] partial class FCManagersEditAssignedCollectionUsers { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); + modelBuilder.HasAnnotation("ProductVersion", "7.0.15"); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => { @@ -137,9 +137,6 @@ namespace Bit.SqliteMigrations.Migrations b.Property("Seats") .HasColumnType("INTEGER"); - b.Property("SecretsManagerBeta") - .HasColumnType("INTEGER"); - b.Property("SelfHost") .HasColumnType("INTEGER"); @@ -534,8 +531,12 @@ namespace Bit.SqliteMigrations.Migrations .HasColumnType("TEXT"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -591,10 +592,20 @@ namespace Bit.SqliteMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/SqliteMigrations/Migrations/20240112123335_FCManagersEditAssignedCollectionUsers.cs b/util/SqliteMigrations/Migrations/20240216131445_FCManagersEditAssignedCollectionUsers.cs similarity index 100% rename from util/SqliteMigrations/Migrations/20240112123335_FCManagersEditAssignedCollectionUsers.cs rename to util/SqliteMigrations/Migrations/20240216131445_FCManagersEditAssignedCollectionUsers.cs diff --git a/util/SqliteMigrations/Migrations/20240112123445_FCEnableOrgsFlexibleCollections.Designer.cs b/util/SqliteMigrations/Migrations/20240216131546_FCEnableOrgsFlexibleCollections.Designer.cs similarity index 99% rename from util/SqliteMigrations/Migrations/20240112123445_FCEnableOrgsFlexibleCollections.Designer.cs rename to util/SqliteMigrations/Migrations/20240216131546_FCEnableOrgsFlexibleCollections.Designer.cs index 5199265927..17b47dcb9a 100644 --- a/util/SqliteMigrations/Migrations/20240112123445_FCEnableOrgsFlexibleCollections.Designer.cs +++ b/util/SqliteMigrations/Migrations/20240216131546_FCEnableOrgsFlexibleCollections.Designer.cs @@ -12,14 +12,14 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.SqliteMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20240112123445_FCEnableOrgsFlexibleCollections")] + [Migration("20240216131546_FCEnableOrgsFlexibleCollections")] partial class FCEnableOrgsFlexibleCollections { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.14"); + modelBuilder.HasAnnotation("ProductVersion", "7.0.15"); modelBuilder.Entity("Bit.Infrastructure.EntityFramework.AdminConsole.Models.Organization", b => { @@ -137,9 +137,6 @@ namespace Bit.SqliteMigrations.Migrations b.Property("Seats") .HasColumnType("INTEGER"); - b.Property("SecretsManagerBeta") - .HasColumnType("INTEGER"); - b.Property("SelfHost") .HasColumnType("INTEGER"); @@ -534,8 +531,12 @@ namespace Bit.SqliteMigrations.Migrations .HasColumnType("TEXT"); b.HasKey("Id") + .HasName("PK_Grant") .HasAnnotation("SqlServer:Clustered", true); + b.HasIndex("ExpirationDate") + .HasAnnotation("SqlServer:Clustered", false); + b.HasIndex("Key") .IsUnique(); @@ -591,10 +592,20 @@ namespace Bit.SqliteMigrations.Migrations b.HasKey("Id"); - b.HasIndex("OrganizationId"); + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); b.HasIndex("UserId"); + b.HasIndex("OrganizationId", "ExternalId") + .IsUnique() + .HasAnnotation("Npgsql:IndexInclude", new[] { "UserId" }) + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId", "UserId") + .IsUnique() + .HasAnnotation("SqlServer:Clustered", false); + b.ToTable("SsoUser", (string)null); }); diff --git a/util/SqliteMigrations/Migrations/20240112123445_FCEnableOrgsFlexibleCollections.cs b/util/SqliteMigrations/Migrations/20240216131546_FCEnableOrgsFlexibleCollections.cs similarity index 100% rename from util/SqliteMigrations/Migrations/20240112123445_FCEnableOrgsFlexibleCollections.cs rename to util/SqliteMigrations/Migrations/20240216131546_FCEnableOrgsFlexibleCollections.cs