mirror of
https://github.com/bitwarden/server
synced 2026-01-09 20:13:24 +00:00
Org admin cleanup
- Added sproc to check if org admin for free org create - Removed old proeprties not in user from org and subvault - Added more cascade deletes
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
CREATE PROCEDURE [dbo].[Organization_Create]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER,
|
||||
@Name NVARCHAR(50),
|
||||
@BusinessName NVARCHAR(50),
|
||||
@BillingEmail NVARCHAR(50),
|
||||
@Plan NVARCHAR(20),
|
||||
@PlanType TINYINT,
|
||||
@PlanBasePrice MONEY,
|
||||
@PlanUserPrice MONEY,
|
||||
@PlanRenewalDate DATETIME2(7),
|
||||
@PlanTrial BIT,
|
||||
@BaseUsers SMALLINT,
|
||||
@AdditionalUsers SMALLINT,
|
||||
@MaxUsers SMALLINT,
|
||||
@StripeCustomerId VARCHAR(50),
|
||||
@StripeSubscriptionId VARCHAR(50),
|
||||
@@ -24,18 +17,11 @@ BEGIN
|
||||
INSERT INTO [dbo].[Organization]
|
||||
(
|
||||
[Id],
|
||||
[UserId],
|
||||
[Name],
|
||||
[BusinessName],
|
||||
[BillingEmail],
|
||||
[Plan],
|
||||
[PlanType],
|
||||
[PlanBasePrice],
|
||||
[PlanUserPrice],
|
||||
[PlanRenewalDate],
|
||||
[PlanTrial],
|
||||
[BaseUsers],
|
||||
[AdditionalUsers],
|
||||
[MaxUsers],
|
||||
[StripeCustomerId],
|
||||
[StripeSubscriptionId],
|
||||
@@ -45,18 +31,11 @@ BEGIN
|
||||
VALUES
|
||||
(
|
||||
@Id,
|
||||
@UserId,
|
||||
@Name,
|
||||
@BusinessName,
|
||||
@BillingEmail,
|
||||
@Plan,
|
||||
@PlanType,
|
||||
@PlanBasePrice,
|
||||
@PlanUserPrice,
|
||||
@PlanRenewalDate,
|
||||
@PlanTrial,
|
||||
@BaseUsers,
|
||||
@AdditionalUsers,
|
||||
@MaxUsers,
|
||||
@StripeCustomerId,
|
||||
@StripeSubscriptionId,
|
||||
|
||||
Reference in New Issue
Block a user