1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -05:00
bitwarden/src/Sql/Billing/Tables/ProviderPlan.sql
Alex Morask 9f7e05869e
[AC-1900] Update Vault DB to support provider billing (#3875)
* Add Gateway columns to Provider table

* Add ProviderId column to Transaction table

* Create ProviderPlan table

* Matt's feedback

* Rui's feedback

* Fixed Gateway parameter on Provider
2024-03-21 11:15:49 -04:00

12 lines
576 B
Transact-SQL

CREATE TABLE [dbo].[ProviderPlan] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[ProviderId] UNIQUEIDENTIFIER NOT NULL,
[PlanType] TINYINT NOT NULL,
[SeatMinimum] INT NULL,
[PurchasedSeats] INT NULL,
[AllocatedSeats] INT NULL,
CONSTRAINT [PK_ProviderPlan] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_ProviderPlan_Provider] FOREIGN KEY ([ProviderId]) REFERENCES [dbo].[Provider] ([Id]) ON DELETE CASCADE,
CONSTRAINT [PK_ProviderPlanType] UNIQUE ([ProviderId], [PlanType])
);