1
0
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:
Kyle Spearrin
2017-04-07 14:52:31 -04:00
parent 52ccef85c6
commit 7497d5ca6f
29 changed files with 47 additions and 98 deletions

View File

@@ -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,