mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
SM-802: Add SecretsManagerBeta Column Migration (#3065)
* SM-802: Add SecretsManagerBetaColumn SQL migration and Org table update * SM-802: Run EF Migrations for SecretsManagerBeta * SM-802: Update the two Org procs and View, and move data migration to a separate file * SM-802: Add missing comma to Organization_Create * SM-802: Remove extra GO statement from data migration script * SM-802: Add SecretsManagerBeta to OrganizationResponseModel * SM-802: Move SecretsManagerBeta from OrganizationResponseModel to OrganizationSubscriptionResponseModel. Use sp_refreshview instead of sp_refreshsqlmodule in the migration script. * SM-802: Remove OrganizationUserOrganizationDetailsView.sql changes * SM-802: Remove SecretsManagerBetaColumn migration * SM-802: Add SecretsManagerBetaColumn migration * SM-802: Remove OrganizationUserOrganizationDetailsView update * SM-802: Remove migration * SM-802: Rename SecretsManagerBetaColumn migration files to have the correct date (now that this has passed QA) * SM-802: Add SecretsManagerBeta migration
This commit is contained in:
@ -104,6 +104,7 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
||||
CoreHelpers.ReadableBytesSize(organization.Storage.Value) : null;
|
||||
StorageGb = organization.Storage.HasValue ?
|
||||
Math.Round(organization.Storage.Value / 1073741824D, 2) : 0; // 1 GB
|
||||
SecretsManagerBeta = organization.SecretsManagerBeta;
|
||||
}
|
||||
|
||||
public OrganizationSubscriptionResponseModel(Organization organization, SubscriptionInfo subscription, bool hideSensitiveData)
|
||||
@ -119,6 +120,8 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
||||
Subscription.Items = null;
|
||||
UpcomingInvoice.Amount = null;
|
||||
}
|
||||
|
||||
SecretsManagerBeta = organization.SecretsManagerBeta;
|
||||
}
|
||||
|
||||
public OrganizationSubscriptionResponseModel(Organization organization, OrganizationLicense license) :
|
||||
@ -133,6 +136,8 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
||||
license.Expires?.AddDays(-Constants
|
||||
.OrganizationSelfHostSubscriptionGracePeriodDays);
|
||||
}
|
||||
|
||||
SecretsManagerBeta = organization.SecretsManagerBeta;
|
||||
}
|
||||
|
||||
public string StorageName { get; set; }
|
||||
@ -149,4 +154,6 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
||||
/// Date when a self-hosted organization expires (includes grace period).
|
||||
/// </summary>
|
||||
public DateTime? Expiration { get; set; }
|
||||
|
||||
public bool SecretsManagerBeta { get; set; }
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ public class Organization : ITableObject<Guid>, ISubscriber, IStorable, IStorabl
|
||||
public int? SmServiceAccounts { get; set; }
|
||||
public int? MaxAutoscaleSmSeats { get; set; }
|
||||
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
||||
public bool SecretsManagerBeta { get; set; }
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
|
@ -49,7 +49,8 @@
|
||||
@SmSeats INT = null,
|
||||
@SmServiceAccounts INT = null,
|
||||
@MaxAutoscaleSmSeats INT= null,
|
||||
@MaxAutoscaleSmServiceAccounts INT = null
|
||||
@MaxAutoscaleSmServiceAccounts INT = null,
|
||||
@SecretsManagerBeta BIT = 0
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
@ -106,7 +107,8 @@ BEGIN
|
||||
[SmSeats],
|
||||
[SmServiceAccounts],
|
||||
[MaxAutoscaleSmSeats],
|
||||
[MaxAutoscaleSmServiceAccounts]
|
||||
[MaxAutoscaleSmServiceAccounts],
|
||||
[SecretsManagerBeta]
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@ -160,6 +162,7 @@ BEGIN
|
||||
@SmSeats,
|
||||
@SmServiceAccounts,
|
||||
@MaxAutoscaleSmSeats,
|
||||
@MaxAutoscaleSmServiceAccounts
|
||||
@MaxAutoscaleSmServiceAccounts,
|
||||
@SecretsManagerBeta
|
||||
)
|
||||
END
|
@ -49,7 +49,8 @@
|
||||
@SmSeats INT = null,
|
||||
@SmServiceAccounts INT = null,
|
||||
@MaxAutoscaleSmSeats INT = null,
|
||||
@MaxAutoscaleSmServiceAccounts INT = null
|
||||
@MaxAutoscaleSmServiceAccounts INT = null,
|
||||
@SecretsManagerBeta BIT = 0
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
@ -106,7 +107,8 @@ BEGIN
|
||||
[SmSeats] = @SmSeats,
|
||||
[SmServiceAccounts] = @SmServiceAccounts,
|
||||
[MaxAutoscaleSmSeats] = @MaxAutoscaleSmSeats,
|
||||
[MaxAutoscaleSmServiceAccounts] = @MaxAutoscaleSmServiceAccounts
|
||||
[MaxAutoscaleSmServiceAccounts] = @MaxAutoscaleSmServiceAccounts,
|
||||
[SecretsManagerBeta] = @SecretsManagerBeta
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
||||
|
@ -50,6 +50,7 @@
|
||||
[SmServiceAccounts] INT NULL,
|
||||
[MaxAutoscaleSmSeats] INT NULL,
|
||||
[MaxAutoscaleSmServiceAccounts] INT NULL,
|
||||
[SecretsManagerBeta] BIT NOT NULL CONSTRAINT [DF_Organization_SecretsManagerBeta] DEFAULT (0),
|
||||
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC)
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user