1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-19 03:58:13 -05:00

add renewal reminder date prop to users

This commit is contained in:
Kyle Spearrin 2018-07-12 17:35:01 -04:00
parent 0524630c33
commit 476ee53931
5 changed files with 35 additions and 1 deletions

View File

@ -32,6 +32,7 @@ namespace Bit.Core.Models.Table
public string PrivateKey { get; set; } public string PrivateKey { get; set; }
public bool Premium { get; set; } public bool Premium { get; set; }
public DateTime? PremiumExpirationDate { get; set; } public DateTime? PremiumExpirationDate { get; set; }
public DateTime? RenewalReminderDate { get; set; }
public long? Storage { get; set; } public long? Storage { get; set; }
public short? MaxStorageGb { get; set; } public short? MaxStorageGb { get; set; }
public GatewayType? Gateway { get; set; } public GatewayType? Gateway { get; set; }

View File

@ -17,6 +17,7 @@
@PrivateKey NVARCHAR(MAX), @PrivateKey NVARCHAR(MAX),
@Premium BIT, @Premium BIT,
@PremiumExpirationDate DATETIME2(7), @PremiumExpirationDate DATETIME2(7),
@RenewalReminderDate DATETIME2(7),
@Storage BIGINT, @Storage BIGINT,
@MaxStorageGb SMALLINT, @MaxStorageGb SMALLINT,
@Gateway TINYINT, @Gateway TINYINT,
@ -49,6 +50,7 @@ BEGIN
[PrivateKey], [PrivateKey],
[Premium], [Premium],
[PremiumExpirationDate], [PremiumExpirationDate],
[RenewalReminderDate],
[Storage], [Storage],
[MaxStorageGb], [MaxStorageGb],
[Gateway], [Gateway],
@ -78,6 +80,7 @@ BEGIN
@PrivateKey, @PrivateKey,
@Premium, @Premium,
@PremiumExpirationDate, @PremiumExpirationDate,
@RenewalReminderDate,
@Storage, @Storage,
@MaxStorageGb, @MaxStorageGb,
@Gateway, @Gateway,

View File

@ -17,6 +17,7 @@
@PrivateKey NVARCHAR(MAX), @PrivateKey NVARCHAR(MAX),
@Premium BIT, @Premium BIT,
@PremiumExpirationDate DATETIME2(7), @PremiumExpirationDate DATETIME2(7),
@RenewalReminderDate DATETIME2(7),
@Storage BIGINT, @Storage BIGINT,
@MaxStorageGb SMALLINT, @MaxStorageGb SMALLINT,
@Gateway TINYINT, @Gateway TINYINT,
@ -49,6 +50,7 @@ BEGIN
[PrivateKey] = @PrivateKey, [PrivateKey] = @PrivateKey,
[Premium] = @Premium, [Premium] = @Premium,
[PremiumExpirationDate] = @PremiumExpirationDate, [PremiumExpirationDate] = @PremiumExpirationDate,
[RenewalReminderDate] = @RenewalReminderDate,
[Storage] = @Storage, [Storage] = @Storage,
[MaxStorageGb] = @MaxStorageGb, [MaxStorageGb] = @MaxStorageGb,
[Gateway] = @Gateway, [Gateway] = @Gateway,

View File

@ -17,6 +17,7 @@
[PrivateKey] VARCHAR (MAX) NULL, [PrivateKey] VARCHAR (MAX) NULL,
[Premium] BIT NOT NULL, [Premium] BIT NOT NULL,
[PremiumExpirationDate] DATETIME2 (7) NULL, [PremiumExpirationDate] DATETIME2 (7) NULL,
[RenewalReminderDate] DATETIME2 (7) NULL,
[Storage] BIGINT NULL, [Storage] BIGINT NULL,
[MaxStorageGb] SMALLINT NULL, [MaxStorageGb] SMALLINT NULL,
[Gateway] TINYINT NULL, [Gateway] TINYINT NULL,
@ -33,3 +34,7 @@ GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_User_Email] CREATE UNIQUE NONCLUSTERED INDEX [IX_User_Email]
ON [dbo].[User]([Email] ASC); ON [dbo].[User]([Email] ASC);
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_User_Premium_PremiumExpirationDate_RenewalReminderDate]
ON [dbo].[User]([Premium] ASC, [PremiumExpirationDate] ASC, [RenewalReminderDate] ASC);

View File

@ -1,4 +1,13 @@
IF OBJECT_ID('[dbo].[Collection_ReadByUserId]') IS NOT NULL IF COL_LENGTH('[dbo].[User]', 'RenewalReminderDate') IS NULL
BEGIN
ALTER TABLE
[dbo].[User]
ADD
[RenewalReminderDate] DATETIME2 (7) NULL
END
GO
IF OBJECT_ID('[dbo].[Collection_ReadByUserId]') IS NOT NULL
BEGIN BEGIN
DROP PROCEDURE [dbo].[Collection_ReadByUserId] DROP PROCEDURE [dbo].[Collection_ReadByUserId]
END END
@ -236,3 +245,17 @@ BEGIN
EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @OrganizationId EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @OrganizationId
END END
GO GO
IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'UserView')
BEGIN
DROP VIEW [dbo].[UserView]
END
GO
CREATE VIEW [dbo].[UserView]
AS
SELECT
*
FROM
[dbo].[User]
GO