diff --git a/util/Migrator/DbScripts/2021-09-21_00_SplitManageCollectionsJson.sql b/util/Migrator/DbScripts/2021-09-21_01_SplitManageCollectionsJson.sql similarity index 96% rename from util/Migrator/DbScripts/2021-09-21_00_SplitManageCollectionsJson.sql rename to util/Migrator/DbScripts/2021-09-21_01_SplitManageCollectionsJson.sql index 0ff29df55c..890e70a1db 100644 --- a/util/Migrator/DbScripts/2021-09-21_00_SplitManageCollectionsJson.sql +++ b/util/Migrator/DbScripts/2021-09-21_01_SplitManageCollectionsJson.sql @@ -1,5 +1,5 @@ -- Split Manage Assigned Collections into edit and delete -UPDATE [vault_dev].[dbo].[OrganizationUser] +UPDATE [dbo].[OrganizationUser] SET [Permissions] = JSON_MODIFY( JSON_MODIFY( @@ -27,7 +27,7 @@ WHERE [Permissions] IS NOT NULL ) -- Split Manage All Collections into create, edit, and delete -UPDATE [vault_dev].[dbo].[OrganizationUser] +UPDATE [dbo].[OrganizationUser] SET [Permissions] = JSON_MODIFY( JSON_MODIFY( diff --git a/util/MySqlMigrations/Migrations/20210921200227_SplitManageCollectionsPermissions.Designer.cs b/util/MySqlMigrations/Migrations/20211011144835_SplitManageCollectionsPermissions2.Designer.cs similarity index 99% rename from util/MySqlMigrations/Migrations/20210921200227_SplitManageCollectionsPermissions.Designer.cs rename to util/MySqlMigrations/Migrations/20211011144835_SplitManageCollectionsPermissions2.Designer.cs index 644759c380..aa86100fbc 100644 --- a/util/MySqlMigrations/Migrations/20210921200227_SplitManageCollectionsPermissions.Designer.cs +++ b/util/MySqlMigrations/Migrations/20211011144835_SplitManageCollectionsPermissions2.Designer.cs @@ -9,8 +9,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Bit.MySqlMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20210921200227_SplitManageCollectionsPermissions")] - partial class SplitManageCollectionsPermissions + [Migration("20211011144835_SplitManageCollectionsPermissions2")] + partial class SplitManageCollectionsPermissions2 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -505,6 +505,9 @@ namespace Bit.MySqlMigrations.Migrations .HasMaxLength(100) .HasColumnType("varchar(100)"); + b.Property("MaxAutoscaleSeats") + .HasColumnType("int"); + b.Property("MaxCollections") .HasColumnType("smallint"); @@ -515,6 +518,9 @@ namespace Bit.MySqlMigrations.Migrations .HasMaxLength(50) .HasColumnType("varchar(50)"); + b.Property("OwnersNotifiedOfAutoscaling") + .HasColumnType("datetime(6)"); + b.Property("Plan") .HasMaxLength(50) .HasColumnType("varchar(50)"); diff --git a/util/MySqlMigrations/Migrations/20210921200227_SplitManageCollectionsPermissions.cs b/util/MySqlMigrations/Migrations/20211011144835_SplitManageCollectionsPermissions2.cs similarity index 80% rename from util/MySqlMigrations/Migrations/20210921200227_SplitManageCollectionsPermissions.cs rename to util/MySqlMigrations/Migrations/20211011144835_SplitManageCollectionsPermissions2.cs index 91056444d9..00029efb83 100644 --- a/util/MySqlMigrations/Migrations/20210921200227_SplitManageCollectionsPermissions.cs +++ b/util/MySqlMigrations/Migrations/20211011144835_SplitManageCollectionsPermissions2.cs @@ -4,10 +4,10 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Bit.MySqlMigrations.Migrations { - public partial class SplitManageCollectionsPermissions : Migration + public partial class SplitManageCollectionsPermissions2 : Migration { private const string _scriptLocation = - "MySqlMigrations.Scripts.2021-09-21_00_SplitManageCollectionsPermission.sql"; + "MySqlMigrations.Scripts.2021-09-21_01_SplitManageCollectionsPermission.sql"; protected override void Up(MigrationBuilder migrationBuilder) { diff --git a/util/MySqlMigrations/MySqlMigrations.csproj b/util/MySqlMigrations/MySqlMigrations.csproj index 49a3b77644..61a99ede23 100644 --- a/util/MySqlMigrations/MySqlMigrations.csproj +++ b/util/MySqlMigrations/MySqlMigrations.csproj @@ -17,9 +17,9 @@ - + - + diff --git a/util/MySqlMigrations/Scripts/2021-09-21_00_SplitManageCollectionsPermission.sql b/util/MySqlMigrations/Scripts/2021-09-21_01_SplitManageCollectionsPermission.sql similarity index 95% rename from util/MySqlMigrations/Scripts/2021-09-21_00_SplitManageCollectionsPermission.sql rename to util/MySqlMigrations/Scripts/2021-09-21_01_SplitManageCollectionsPermission.sql index d2ba40f63e..5972cb3c2a 100644 --- a/util/MySqlMigrations/Scripts/2021-09-21_00_SplitManageCollectionsPermission.sql +++ b/util/MySqlMigrations/Scripts/2021-09-21_01_SplitManageCollectionsPermission.sql @@ -1,5 +1,5 @@ -- Split Manage Assigned Collections into edit and delete -UPDATE `bw-vault`.`OrganizationUser` +UPDATE `OrganizationUser` SET `Permissions` = JSON_INSERT( `Permissions`, @@ -24,7 +24,7 @@ WHERE `Permissions` IS NOT NULL ); -- Split Manage All Collections into create, edit, and delete -UPDATE `bw-vault`.`OrganizationUser` +UPDATE `OrganizationUser` SET `Permissions` = JSON_INSERT( `Permissions`, diff --git a/util/PostgresMigrations/Migrations/20210921163012_SplitManageCollectionsPermissions.Designer.cs b/util/PostgresMigrations/Migrations/20211011145128_SplitManageCollectionsPermissions2.Designer.cs similarity index 99% rename from util/PostgresMigrations/Migrations/20210921163012_SplitManageCollectionsPermissions.Designer.cs rename to util/PostgresMigrations/Migrations/20211011145128_SplitManageCollectionsPermissions2.Designer.cs index 46a7850bd3..daf45b7567 100644 --- a/util/PostgresMigrations/Migrations/20210921163012_SplitManageCollectionsPermissions.Designer.cs +++ b/util/PostgresMigrations/Migrations/20211011145128_SplitManageCollectionsPermissions2.Designer.cs @@ -10,8 +10,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Bit.PostgresMigrations.Migrations { [DbContext(typeof(DatabaseContext))] - [Migration("20210921163012_SplitManageCollectionsPermissions")] - partial class SplitManageCollectionsPermissions + [Migration("20211011145128_SplitManageCollectionsPermissions2")] + partial class SplitManageCollectionsPermissions2 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -509,6 +509,9 @@ namespace Bit.PostgresMigrations.Migrations .HasMaxLength(100) .HasColumnType("character varying(100)"); + b.Property("MaxAutoscaleSeats") + .HasColumnType("integer"); + b.Property("MaxCollections") .HasColumnType("smallint"); @@ -519,6 +522,9 @@ namespace Bit.PostgresMigrations.Migrations .HasMaxLength(50) .HasColumnType("character varying(50)"); + b.Property("OwnersNotifiedOfAutoscaling") + .HasColumnType("timestamp without time zone"); + b.Property("Plan") .HasMaxLength(50) .HasColumnType("character varying(50)"); diff --git a/util/PostgresMigrations/Migrations/20210921163012_SplitManageCollectionsPermissions.cs b/util/PostgresMigrations/Migrations/20211011145128_SplitManageCollectionsPermissions2.cs similarity index 80% rename from util/PostgresMigrations/Migrations/20210921163012_SplitManageCollectionsPermissions.cs rename to util/PostgresMigrations/Migrations/20211011145128_SplitManageCollectionsPermissions2.cs index ebf79c3969..9a9c94e994 100644 --- a/util/PostgresMigrations/Migrations/20210921163012_SplitManageCollectionsPermissions.cs +++ b/util/PostgresMigrations/Migrations/20211011145128_SplitManageCollectionsPermissions2.cs @@ -4,10 +4,10 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Bit.PostgresMigrations.Migrations { - public partial class SplitManageCollectionsPermissions : Migration + public partial class SplitManageCollectionsPermissions2 : Migration { private const string _scriptLocation = - "PostgresMigration.Scripts.2021-09-21_00_SplitManageCollectionsPermission.psql"; + "PostgresMigration.Scripts.2021-09-21_01_SplitManageCollectionsPermission.psql"; protected override void Up(MigrationBuilder migrationBuilder) { diff --git a/util/PostgresMigrations/PostgresMigrations.csproj b/util/PostgresMigrations/PostgresMigrations.csproj index 6fb1ff46cc..fe22961bc0 100644 --- a/util/PostgresMigrations/PostgresMigrations.csproj +++ b/util/PostgresMigrations/PostgresMigrations.csproj @@ -17,9 +17,9 @@ - + - + diff --git a/util/PostgresMigrations/Scripts/2021-09-21_00_SplitManageCollectionsPermission.psql b/util/PostgresMigrations/Scripts/2021-09-21_01_SplitManageCollectionsPermission.psql similarity index 98% rename from util/PostgresMigrations/Scripts/2021-09-21_00_SplitManageCollectionsPermission.psql rename to util/PostgresMigrations/Scripts/2021-09-21_01_SplitManageCollectionsPermission.psql index 0cd35df0d5..ad21bd4733 100644 --- a/util/PostgresMigrations/Scripts/2021-09-21_00_SplitManageCollectionsPermission.psql +++ b/util/PostgresMigrations/Scripts/2021-09-21_01_SplitManageCollectionsPermission.psql @@ -35,7 +35,7 @@ CREATE OR REPLACE FUNCTION updatePermissionsJson(permissions jsonb) returns json END $$; -UPDATE public."OrganizationUser" +UPDATE "OrganizationUser" SET "Permissions" = updatePermissionsJson("Permissions"::jsonb)::text WHERE "Permissions" IS NOT NULL;