mirror of
https://github.com/bitwarden/server
synced 2026-02-26 17:33:40 +00:00
[PM 30100][Server] Subscription Discount Database Infrastructure (#6936)
* Implement the detail Subscription Discount Database Infrastructure * Change string to string list * fix lint error * Create all missing database object definition files * Regenerate EF migrations with Designer files The previous migrations were missing .Designer.cs files. This commit: - Removes the incomplete migration files - Regenerates all three provider migrations (MySQL, Postgres, SQLite) with proper Designer files - Updates DatabaseContextModelSnapshot.cs for each provider 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix failing database * Resolve the lint warnings * Resolve the database failure * Fix the build Lint * resolve the dbops reviews * Add the default value --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
13
src/Core/Billing/Enums/DiscountAudienceType.cs
Normal file
13
src/Core/Billing/Enums/DiscountAudienceType.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Bit.Core.Billing.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the target audience for subscription discounts using an extensible strategy pattern.
|
||||
/// Each audience type maps to specific eligibility rules implemented via IDiscountAudienceFilter.
|
||||
/// </summary>
|
||||
public enum DiscountAudienceType
|
||||
{
|
||||
/// <summary>
|
||||
/// Discount applies to users who have never had a subscription before.
|
||||
/// </summary>
|
||||
UserHasNoPreviousSubscriptions = 0
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
#nullable enable
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Billing.Enums;
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Billing.Subscriptions.Entities;
|
||||
|
||||
public class SubscriptionDiscount : ITableObject<Guid>, IRevisable, IValidatableObject
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string StripeCouponId { get; set; } = null!;
|
||||
public ICollection<string>? StripeProductIds { get; set; }
|
||||
public decimal? PercentOff { get; set; }
|
||||
public long? AmountOff { get; set; }
|
||||
[MaxLength(10)]
|
||||
public string? Currency { get; set; }
|
||||
[MaxLength(20)]
|
||||
public string Duration { get; set; } = null!;
|
||||
public int? DurationInMonths { get; set; }
|
||||
[MaxLength(100)]
|
||||
public string? Name { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public DiscountAudienceType AudienceType { get; set; }
|
||||
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
if (Id == default)
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (EndDate < StartDate)
|
||||
{
|
||||
yield return new ValidationResult(
|
||||
"EndDate must be greater than or equal to StartDate.",
|
||||
new[] { nameof(EndDate) });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#nullable enable
|
||||
|
||||
using Bit.Core.Billing.Subscriptions.Entities;
|
||||
using Bit.Core.Repositories;
|
||||
|
||||
namespace Bit.Core.Billing.Subscriptions.Repositories;
|
||||
|
||||
public interface ISubscriptionDiscountRepository : IRepository<SubscriptionDiscount, Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves all active subscription discounts that are currently within their valid date range.
|
||||
/// A discount is considered active if the current UTC date falls between StartDate (inclusive) and EndDate (inclusive).
|
||||
/// </summary>
|
||||
/// <returns>A collection of active subscription discounts.</returns>
|
||||
Task<ICollection<SubscriptionDiscount>> GetActiveDiscountsAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a subscription discount by its Stripe coupon ID.
|
||||
/// </summary>
|
||||
/// <param name="stripeCouponId">The Stripe coupon ID to search for.</param>
|
||||
/// <returns>The subscription discount if found; otherwise, null.</returns>
|
||||
Task<SubscriptionDiscount?> GetByStripeCouponIdAsync(string stripeCouponId);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.Data;
|
||||
using Bit.Core.Billing.Subscriptions.Entities;
|
||||
using Bit.Core.Billing.Subscriptions.Repositories;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Infrastructure.Dapper.Repositories;
|
||||
using Dapper;
|
||||
using Microsoft.Data.SqlClient;
|
||||
|
||||
namespace Bit.Infrastructure.Dapper.Billing.Repositories;
|
||||
|
||||
public class SubscriptionDiscountRepository(
|
||||
GlobalSettings globalSettings)
|
||||
: Repository<SubscriptionDiscount, Guid>(
|
||||
globalSettings.SqlServer.ConnectionString,
|
||||
globalSettings.SqlServer.ReadOnlyConnectionString), ISubscriptionDiscountRepository
|
||||
{
|
||||
public async Task<ICollection<SubscriptionDiscount>> GetActiveDiscountsAsync()
|
||||
{
|
||||
using var sqlConnection = new SqlConnection(ReadOnlyConnectionString);
|
||||
|
||||
var results = await sqlConnection.QueryAsync<SubscriptionDiscount>(
|
||||
"[dbo].[SubscriptionDiscount_ReadActive]",
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.ToArray();
|
||||
}
|
||||
|
||||
public async Task<SubscriptionDiscount?> GetByStripeCouponIdAsync(string stripeCouponId)
|
||||
{
|
||||
using var sqlConnection = new SqlConnection(ReadOnlyConnectionString);
|
||||
|
||||
var result = await sqlConnection.QueryFirstOrDefaultAsync<SubscriptionDiscount>(
|
||||
"[dbo].[SubscriptionDiscount_ReadByStripeCouponId]",
|
||||
new { StripeCouponId = stripeCouponId },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Bit.Core.Auth.Repositories;
|
||||
using Bit.Core.Billing.Organizations.Repositories;
|
||||
using Bit.Core.Billing.Providers.Repositories;
|
||||
using Bit.Core.Billing.Subscriptions.Repositories;
|
||||
using Bit.Core.Dirt.Reports.Repositories;
|
||||
using Bit.Core.Dirt.Repositories;
|
||||
using Bit.Core.KeyManagement.Repositories;
|
||||
@@ -65,6 +66,7 @@ public static class DapperServiceCollectionExtensions
|
||||
services.AddSingleton<IWebAuthnCredentialRepository, WebAuthnCredentialRepository>();
|
||||
services.AddSingleton<IProviderPlanRepository, ProviderPlanRepository>();
|
||||
services.AddSingleton<IProviderInvoiceItemRepository, ProviderInvoiceItemRepository>();
|
||||
services.AddSingleton<ISubscriptionDiscountRepository, SubscriptionDiscountRepository>();
|
||||
services.AddSingleton<INotificationRepository, NotificationRepository>();
|
||||
services.AddSingleton<INotificationStatusRepository, NotificationStatusRepository>();
|
||||
services
|
||||
|
||||
@@ -9,6 +9,7 @@ public abstract class BaseRepository
|
||||
static BaseRepository()
|
||||
{
|
||||
SqlMapper.AddTypeHandler(new DateTimeHandler());
|
||||
SqlMapper.AddTypeHandler(new JsonCollectionTypeHandler());
|
||||
}
|
||||
|
||||
public BaseRepository(string connectionString, string readOnlyConnectionString)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Data;
|
||||
using System.Text.Json;
|
||||
using Dapper;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Bit.Infrastructure.Dapper.Repositories;
|
||||
|
||||
public class JsonCollectionTypeHandler : SqlMapper.TypeHandler<ICollection<string>?>
|
||||
{
|
||||
public override void SetValue(IDbDataParameter parameter, ICollection<string>? value)
|
||||
{
|
||||
parameter.Value = value == null ? (object)DBNull.Value : JsonSerializer.Serialize(value);
|
||||
}
|
||||
|
||||
public override ICollection<string>? Parse(object value)
|
||||
{
|
||||
if (value == null || value is DBNull)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var json = value.ToString();
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return JsonSerializer.Deserialize<List<string>>(json);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Text.Json;
|
||||
using Bit.Infrastructure.EntityFramework.Billing.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Billing.Configurations;
|
||||
|
||||
public class SubscriptionDiscountEntityTypeConfiguration : IEntityTypeConfiguration<SubscriptionDiscount>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SubscriptionDiscount> builder)
|
||||
{
|
||||
builder
|
||||
.Property(t => t.Id)
|
||||
.ValueGeneratedNever();
|
||||
|
||||
builder
|
||||
.HasIndex(sd => sd.StripeCouponId)
|
||||
.IsUnique();
|
||||
|
||||
builder
|
||||
.Property(sd => sd.StripeProductIds)
|
||||
.HasConversion(
|
||||
v => v == null ? null : JsonSerializer.Serialize(v, (JsonSerializerOptions?)null),
|
||||
v => v == null ? null : JsonSerializer.Deserialize<List<string>>(v, (JsonSerializerOptions?)null),
|
||||
new ValueComparer<ICollection<string>?>(
|
||||
(c1, c2) => (c1 == null && c2 == null) || (c1 != null && c2 != null && c1.SequenceEqual(c2)),
|
||||
c => c == null ? 0 : c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())),
|
||||
c => c == null ? null : c.ToList()));
|
||||
|
||||
builder
|
||||
.Property(sd => sd.PercentOff)
|
||||
.HasPrecision(5, 2);
|
||||
|
||||
builder
|
||||
.HasIndex(sd => new { sd.StartDate, sd.EndDate })
|
||||
.IsClustered(false)
|
||||
.HasDatabaseName("IX_SubscriptionDiscount_DateRange");
|
||||
|
||||
builder.ToTable(nameof(SubscriptionDiscount));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#nullable enable
|
||||
|
||||
using AutoMapper;
|
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Billing.Models;
|
||||
|
||||
// ReSharper disable once ClassWithVirtualMembersNeverInherited.Global
|
||||
public class SubscriptionDiscount : Core.Billing.Subscriptions.Entities.SubscriptionDiscount
|
||||
{
|
||||
}
|
||||
|
||||
public class SubscriptionDiscountMapperProfile : Profile
|
||||
{
|
||||
public SubscriptionDiscountMapperProfile()
|
||||
{
|
||||
CreateMap<Core.Billing.Subscriptions.Entities.SubscriptionDiscount, SubscriptionDiscount>().ReverseMap();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using AutoMapper;
|
||||
using Bit.Core.Billing.Subscriptions.Entities;
|
||||
using Bit.Core.Billing.Subscriptions.Repositories;
|
||||
using Bit.Infrastructure.EntityFramework.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using EFSubscriptionDiscount = Bit.Infrastructure.EntityFramework.Billing.Models.SubscriptionDiscount;
|
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Billing.Repositories;
|
||||
|
||||
public class SubscriptionDiscountRepository(
|
||||
IMapper mapper,
|
||||
IServiceScopeFactory serviceScopeFactory)
|
||||
: Repository<SubscriptionDiscount, EFSubscriptionDiscount, Guid>(
|
||||
serviceScopeFactory,
|
||||
mapper,
|
||||
context => context.SubscriptionDiscounts), ISubscriptionDiscountRepository
|
||||
{
|
||||
public async Task<ICollection<SubscriptionDiscount>> GetActiveDiscountsAsync()
|
||||
{
|
||||
using var serviceScope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
var databaseContext = GetDatabaseContext(serviceScope);
|
||||
|
||||
var query =
|
||||
from subscriptionDiscount in databaseContext.SubscriptionDiscounts
|
||||
where subscriptionDiscount.StartDate <= DateTime.UtcNow
|
||||
&& subscriptionDiscount.EndDate >= DateTime.UtcNow
|
||||
select subscriptionDiscount;
|
||||
|
||||
var results = await query.ToArrayAsync();
|
||||
|
||||
return Mapper.Map<List<SubscriptionDiscount>>(results);
|
||||
}
|
||||
|
||||
public async Task<SubscriptionDiscount?> GetByStripeCouponIdAsync(string stripeCouponId)
|
||||
{
|
||||
using var serviceScope = ServiceScopeFactory.CreateScope();
|
||||
|
||||
var databaseContext = GetDatabaseContext(serviceScope);
|
||||
|
||||
var query =
|
||||
from subscriptionDiscount in databaseContext.SubscriptionDiscounts
|
||||
where subscriptionDiscount.StripeCouponId == stripeCouponId
|
||||
select subscriptionDiscount;
|
||||
|
||||
var result = await query.FirstOrDefaultAsync();
|
||||
|
||||
return result == null ? null : Mapper.Map<SubscriptionDiscount>(result);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Bit.Core.Auth.Repositories;
|
||||
using Bit.Core.Billing.Organizations.Repositories;
|
||||
using Bit.Core.Billing.Providers.Repositories;
|
||||
using Bit.Core.Billing.Subscriptions.Repositories;
|
||||
using Bit.Core.Dirt.Reports.Repositories;
|
||||
using Bit.Core.Dirt.Repositories;
|
||||
using Bit.Core.Enums;
|
||||
@@ -102,6 +103,7 @@ public static class EntityFrameworkServiceCollectionExtensions
|
||||
services.AddSingleton<IWebAuthnCredentialRepository, WebAuthnCredentialRepository>();
|
||||
services.AddSingleton<IProviderPlanRepository, ProviderPlanRepository>();
|
||||
services.AddSingleton<IProviderInvoiceItemRepository, ProviderInvoiceItemRepository>();
|
||||
services.AddSingleton<ISubscriptionDiscountRepository, SubscriptionDiscountRepository>();
|
||||
services.AddSingleton<INotificationRepository, NotificationRepository>();
|
||||
services.AddSingleton<INotificationStatusRepository, NotificationStatusRepository>();
|
||||
services
|
||||
|
||||
@@ -79,6 +79,7 @@ public class DatabaseContext : DbContext
|
||||
public DbSet<WebAuthnCredential> WebAuthnCredentials { get; set; }
|
||||
public DbSet<ProviderPlan> ProviderPlans { get; set; }
|
||||
public DbSet<ProviderInvoiceItem> ProviderInvoiceItems { get; set; }
|
||||
public DbSet<SubscriptionDiscount> SubscriptionDiscounts { get; set; }
|
||||
public DbSet<Notification> Notifications { get; set; }
|
||||
public DbSet<NotificationStatus> NotificationStatuses { get; set; }
|
||||
public DbSet<ClientOrganizationMigrationRecord> ClientOrganizationMigrationRecords { get; set; }
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
CREATE PROCEDURE [dbo].[SubscriptionDiscount_Create]
|
||||
@Id UNIQUEIDENTIFIER OUTPUT,
|
||||
@StripeCouponId VARCHAR(50),
|
||||
@StripeProductIds NVARCHAR(MAX),
|
||||
@PercentOff DECIMAL(5,2),
|
||||
@AmountOff BIGINT,
|
||||
@Currency VARCHAR(10),
|
||||
@Duration VARCHAR(20),
|
||||
@DurationInMonths INT,
|
||||
@Name NVARCHAR(100),
|
||||
@StartDate DATETIME2(7),
|
||||
@EndDate DATETIME2(7),
|
||||
@AudienceType INT,
|
||||
@CreationDate DATETIME2(7),
|
||||
@RevisionDate DATETIME2(7)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
INSERT INTO [dbo].[SubscriptionDiscount]
|
||||
(
|
||||
[Id],
|
||||
[StripeCouponId],
|
||||
[StripeProductIds],
|
||||
[PercentOff],
|
||||
[AmountOff],
|
||||
[Currency],
|
||||
[Duration],
|
||||
[DurationInMonths],
|
||||
[Name],
|
||||
[StartDate],
|
||||
[EndDate],
|
||||
[AudienceType],
|
||||
[CreationDate],
|
||||
[RevisionDate]
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@Id,
|
||||
@StripeCouponId,
|
||||
@StripeProductIds,
|
||||
@PercentOff,
|
||||
@AmountOff,
|
||||
@Currency,
|
||||
@Duration,
|
||||
@DurationInMonths,
|
||||
@Name,
|
||||
@StartDate,
|
||||
@EndDate,
|
||||
@AudienceType,
|
||||
@CreationDate,
|
||||
@RevisionDate
|
||||
)
|
||||
END
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE PROCEDURE [dbo].[SubscriptionDiscount_DeleteById]
|
||||
@Id UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
DELETE
|
||||
FROM
|
||||
[dbo].[SubscriptionDiscount]
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
||||
@@ -0,0 +1,13 @@
|
||||
CREATE PROCEDURE [dbo].[SubscriptionDiscount_ReadActive]
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[SubscriptionDiscountView]
|
||||
WHERE
|
||||
[StartDate] <= GETUTCDATE()
|
||||
AND [EndDate] >= GETUTCDATE()
|
||||
END
|
||||
@@ -0,0 +1,13 @@
|
||||
CREATE PROCEDURE [dbo].[SubscriptionDiscount_ReadById]
|
||||
@Id UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[SubscriptionDiscountView]
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
||||
@@ -0,0 +1,13 @@
|
||||
CREATE PROCEDURE [dbo].[SubscriptionDiscount_ReadByStripeCouponId]
|
||||
@StripeCouponId VARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[SubscriptionDiscountView]
|
||||
WHERE
|
||||
[StripeCouponId] = @StripeCouponId
|
||||
END
|
||||
@@ -0,0 +1,38 @@
|
||||
CREATE PROCEDURE [dbo].[SubscriptionDiscount_Update]
|
||||
@Id UNIQUEIDENTIFIER OUTPUT,
|
||||
@StripeCouponId VARCHAR(50),
|
||||
@StripeProductIds NVARCHAR(MAX),
|
||||
@PercentOff DECIMAL(5,2),
|
||||
@AmountOff BIGINT,
|
||||
@Currency VARCHAR(10),
|
||||
@Duration VARCHAR(20),
|
||||
@DurationInMonths INT,
|
||||
@Name NVARCHAR(100),
|
||||
@StartDate DATETIME2(7),
|
||||
@EndDate DATETIME2(7),
|
||||
@AudienceType INT,
|
||||
@CreationDate DATETIME2(7),
|
||||
@RevisionDate DATETIME2(7)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
UPDATE
|
||||
[dbo].[SubscriptionDiscount]
|
||||
SET
|
||||
[StripeCouponId] = @StripeCouponId,
|
||||
[StripeProductIds] = @StripeProductIds,
|
||||
[PercentOff] = @PercentOff,
|
||||
[AmountOff] = @AmountOff,
|
||||
[Currency] = @Currency,
|
||||
[Duration] = @Duration,
|
||||
[DurationInMonths] = @DurationInMonths,
|
||||
[Name] = @Name,
|
||||
[StartDate] = @StartDate,
|
||||
[EndDate] = @EndDate,
|
||||
[AudienceType] = @AudienceType,
|
||||
[CreationDate] = @CreationDate,
|
||||
[RevisionDate] = @RevisionDate
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
||||
22
src/Sql/dbo/Tables/SubscriptionDiscount.sql
Normal file
22
src/Sql/dbo/Tables/SubscriptionDiscount.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE [dbo].[SubscriptionDiscount] (
|
||||
[Id] UNIQUEIDENTIFIER NOT NULL,
|
||||
[StripeCouponId] VARCHAR (50) NOT NULL,
|
||||
[StripeProductIds] NVARCHAR (MAX) NULL,
|
||||
[PercentOff] DECIMAL (5, 2) NULL,
|
||||
[AmountOff] BIGINT NULL,
|
||||
[Currency] VARCHAR (10) NULL,
|
||||
[Duration] VARCHAR (20) NOT NULL,
|
||||
[DurationInMonths] INT NULL,
|
||||
[Name] NVARCHAR (100) NULL,
|
||||
[StartDate] DATETIME2 (7) NOT NULL,
|
||||
[EndDate] DATETIME2 (7) NOT NULL,
|
||||
[AudienceType] INT NOT NULL CONSTRAINT [DF_SubscriptionDiscount_AudienceType] DEFAULT (0),
|
||||
[CreationDate] DATETIME2 (7) NOT NULL,
|
||||
[RevisionDate] DATETIME2 (7) NOT NULL,
|
||||
CONSTRAINT [PK_SubscriptionDiscount] PRIMARY KEY CLUSTERED ([Id] ASC),
|
||||
CONSTRAINT [IX_SubscriptionDiscount_StripeCouponId] UNIQUE NONCLUSTERED ([StripeCouponId] ASC)
|
||||
);
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_SubscriptionDiscount_DateRange]
|
||||
ON [dbo].[SubscriptionDiscount]([StartDate] ASC, [EndDate] ASC);
|
||||
5
src/Sql/dbo/Views/SubscriptionDiscountView.sql
Normal file
5
src/Sql/dbo/Views/SubscriptionDiscountView.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
CREATE VIEW [dbo].[SubscriptionDiscountView]
|
||||
AS
|
||||
SELECT *
|
||||
FROM
|
||||
[dbo].[SubscriptionDiscount]
|
||||
Reference in New Issue
Block a user