1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

organization signup apis and data model changes

This commit is contained in:
Kyle Spearrin
2017-03-03 00:07:11 -05:00
parent b18b6a44ef
commit 29e3605576
20 changed files with 371 additions and 131 deletions

View File

@ -1,5 +1,5 @@
CREATE PROCEDURE [dbo].[OrganizationUser_ReadByIdUserId]
@Id UNIQUEIDENTIFIER,
CREATE PROCEDURE [dbo].[OrganizationUser_ReadByOrganizationIdUserId]
@OrganizationId UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER
AS
BEGIN
@ -10,6 +10,6 @@ BEGIN
FROM
[dbo].[OrganizationUserView]
WHERE
[Id] = @Id
[OrganizationId] = @OrganizationId
AND [UserId] = @UserId
END

View File

@ -2,7 +2,12 @@
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER,
@Name NVARCHAR(50),
@Plan TINYINT,
@Plan NVARCHAR(20),
@PlanType TINYINT,
@PlanPrice MONEY,
@PlanRenewalPrice MONEY,
@PlanRenewalDate DATETIME2(7),
@PlanTrial BIT,
@MaxUsers SMALLINT,
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7)
@ -16,6 +21,11 @@ BEGIN
[UserId],
[Name],
[Plan],
[PlanType],
[PlanPrice],
[PlanRenewalPrice],
[PlanRenewalDate],
[PlanTrial],
[MaxUsers],
[CreationDate],
[RevisionDate]
@ -26,6 +36,11 @@ BEGIN
@UserId,
@Name,
@Plan,
@PlanType,
@PlanPrice,
@PlanRenewalPrice,
@PlanRenewalDate,
@PlanTrial,
@MaxUsers,
@CreationDate,
@RevisionDate

View File

@ -2,7 +2,12 @@
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER,
@Name NVARCHAR(50),
@Plan TINYINT,
@Plan NVARCHAR(20),
@PlanType TINYINT,
@PlanPrice MONEY,
@PlanRenewalPrice MONEY,
@PlanRenewalDate DATETIME2(7),
@PlanTrial BIT,
@MaxUsers SMALLINT,
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7)
@ -16,6 +21,11 @@ BEGIN
[UserId] = @UserId,
[Name] = @Name,
[Plan] = @Plan,
[PlanType] = @PlanType,
[PlanPrice] = @PlanPrice,
[PlanRenewalPrice] = @PlanRenewalPrice,
[PlanRenewalDate] = @PlanRenewalDate,
[PlanTrial] = @PlanTrial,
[MaxUsers] = @MaxUsers,
[CreationDate] = @CreationDate,
[RevisionDate] = @RevisionDate

View File

@ -1,11 +1,16 @@
CREATE TABLE [dbo].[Organization] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[Plan] TINYINT NOT NULL,
[MaxUsers] SMALLINT NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
[Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[Plan] NVARCHAR (20) NOT NULL,
[PlanType] TINYINT NOT NULL,
[PlanPrice] MONEY NOT NULL,
[PlanRenewalPrice] MONEY NOT NULL,
[PlanRenewalDate] DATETIME2 (7) NULL,
[PlanTrial] BIT NOT NULL,
[MaxUsers] SMALLINT NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Organization_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])
);