Initial commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,293 @@
|
||||
using System.Data;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PowderCoating.Core.Entities;
|
||||
|
||||
namespace PowderCoating.Infrastructure.Data;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core SaveChanges interceptor that writes an AuditLog row for every
|
||||
/// meaningful create / update / soft-delete on tracked entities.
|
||||
/// Writes via raw SQL so it never re-triggers itself.
|
||||
/// </summary>
|
||||
public class AuditInterceptor : SaveChangesInterceptor
|
||||
{
|
||||
// Entity types we care about auditing
|
||||
private static readonly HashSet<string> AuditedTypes = new(StringComparer.Ordinal)
|
||||
{
|
||||
nameof(Customer), nameof(Job), nameof(Quote), nameof(Equipment),
|
||||
nameof(MaintenanceRecord), nameof(Vendor), nameof(ShopWorker),
|
||||
nameof(InventoryItem), nameof(Company),
|
||||
// Financial entities
|
||||
nameof(Invoice), nameof(Payment), nameof(Bill), nameof(BillPayment),
|
||||
nameof(Deposit), nameof(CreditMemo), nameof(GiftCertificate),
|
||||
nameof(Expense), nameof(PurchaseOrder),
|
||||
// Operations
|
||||
nameof(Appointment), nameof(InventoryTransaction), nameof(JobTemplate),
|
||||
// User management
|
||||
nameof(ApplicationUser)
|
||||
};
|
||||
|
||||
// Properties to always exclude from change capture (noisy / binary)
|
||||
private static readonly HashSet<string> ExcludedProperties = new(StringComparer.Ordinal)
|
||||
{
|
||||
"LogoData", "ProfilePictureData", "Settings", "UpdatedAt", "CreatedAt"
|
||||
};
|
||||
|
||||
// Per-context pending audit entries (ConditionalWeakTable gives us automatic cleanup)
|
||||
private readonly ConditionalWeakTable<DbContext, List<AuditLog>> _pending = new();
|
||||
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly ILogger<AuditInterceptor> _logger;
|
||||
|
||||
public AuditInterceptor(IHttpContextAccessor httpContextAccessor, ILogger<AuditInterceptor> logger)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// ── Collect entries BEFORE save (so we can capture OriginalValues) ──────────
|
||||
|
||||
public override InterceptionResult<int> SavingChanges(DbContextEventData eventData, InterceptionResult<int> result)
|
||||
{
|
||||
Collect(eventData.Context);
|
||||
return base.SavingChanges(eventData, result);
|
||||
}
|
||||
|
||||
public override ValueTask<InterceptionResult<int>> SavingChangesAsync(
|
||||
DbContextEventData eventData, InterceptionResult<int> result, CancellationToken cancellationToken = default)
|
||||
{
|
||||
Collect(eventData.Context);
|
||||
return base.SavingChangesAsync(eventData, result, cancellationToken);
|
||||
}
|
||||
|
||||
// ── Write entries AFTER save (entity IDs are populated now) ─────────────────
|
||||
|
||||
public override int SavedChanges(SaveChangesCompletedEventData eventData, int result)
|
||||
{
|
||||
FlushSync(eventData.Context);
|
||||
return base.SavedChanges(eventData, result);
|
||||
}
|
||||
|
||||
public override async ValueTask<int> SavedChangesAsync(
|
||||
SaveChangesCompletedEventData eventData, int result, CancellationToken cancellationToken = default)
|
||||
{
|
||||
await FlushAsync(eventData.Context, cancellationToken);
|
||||
return await base.SavedChangesAsync(eventData, result, cancellationToken);
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
private void Collect(DbContext? context)
|
||||
{
|
||||
if (context == null) return;
|
||||
var entries = BuildEntries(context);
|
||||
if (entries.Count == 0) return;
|
||||
|
||||
// Remove any stale entries left by a previous failed SaveChanges on this context.
|
||||
// Without this, EF Core's EnableRetryOnFailure would trigger a second SavingChanges
|
||||
// on the same DbContext instance, causing _pending.Add to throw ArgumentException.
|
||||
_pending.Remove(context);
|
||||
_pending.Add(context, entries);
|
||||
}
|
||||
|
||||
private void FlushSync(DbContext? context)
|
||||
{
|
||||
if (context == null || !_pending.TryGetValue(context, out var entries)) return;
|
||||
_pending.Remove(context);
|
||||
foreach (var log in entries)
|
||||
{
|
||||
try { InsertSync(context, log); }
|
||||
catch (Exception ex) { _logger.LogError(ex, "Failed to write audit log entry for {Action} on {EntityType} {EntityId}", log.Action, log.EntityType, log.EntityId); }
|
||||
}
|
||||
}
|
||||
|
||||
private async Task FlushAsync(DbContext? context, CancellationToken ct)
|
||||
{
|
||||
if (context == null || !_pending.TryGetValue(context, out var entries)) return;
|
||||
_pending.Remove(context);
|
||||
foreach (var log in entries)
|
||||
{
|
||||
try { await InsertAsync(context, log, ct); }
|
||||
catch (Exception ex) { _logger.LogError(ex, "Failed to write audit log entry for {Action} on {EntityType} {EntityId}", log.Action, log.EntityType, log.EntityId); }
|
||||
}
|
||||
}
|
||||
|
||||
// ── Build AuditLog objects from change tracker ───────────────────────────────
|
||||
|
||||
private List<AuditLog> BuildEntries(DbContext context)
|
||||
{
|
||||
var logs = new List<AuditLog>();
|
||||
var (userId, userName, companyId, ip) = GetRequestContext();
|
||||
|
||||
foreach (var entry in context.ChangeTracker.Entries())
|
||||
{
|
||||
var typeName = entry.Entity.GetType().Name;
|
||||
if (!AuditedTypes.Contains(typeName)) continue;
|
||||
|
||||
string action;
|
||||
string? oldJson = null;
|
||||
string? newJson = null;
|
||||
|
||||
switch (entry.State)
|
||||
{
|
||||
case EntityState.Added:
|
||||
action = "Created";
|
||||
newJson = SerializeProperties(entry.CurrentValues, null);
|
||||
break;
|
||||
|
||||
case EntityState.Modified:
|
||||
// Detect soft-delete vs plain update
|
||||
var isDeletedProp = entry.Properties.FirstOrDefault(p => p.Metadata.Name == "IsDeleted");
|
||||
if (isDeletedProp != null &&
|
||||
isDeletedProp.CurrentValue is true &&
|
||||
isDeletedProp.OriginalValue is false)
|
||||
{
|
||||
action = "Deleted";
|
||||
}
|
||||
else if (isDeletedProp != null &&
|
||||
isDeletedProp.CurrentValue is false &&
|
||||
isDeletedProp.OriginalValue is true)
|
||||
{
|
||||
action = "Restored";
|
||||
}
|
||||
else
|
||||
{
|
||||
action = "Updated";
|
||||
}
|
||||
oldJson = SerializeProperties(entry.OriginalValues, entry.CurrentValues);
|
||||
newJson = SerializeProperties(entry.CurrentValues, entry.OriginalValues);
|
||||
break;
|
||||
|
||||
case EntityState.Deleted:
|
||||
action = "Deleted";
|
||||
oldJson = SerializeProperties(entry.OriginalValues, null);
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
// Entity ID — try "Id" property
|
||||
var idProp = entry.Properties.FirstOrDefault(p => p.Metadata.Name == "Id");
|
||||
var entityId = idProp?.CurrentValue?.ToString();
|
||||
|
||||
// Entity description — try common naming properties
|
||||
var description = GetDescription(entry);
|
||||
|
||||
// Company ID on the entity itself
|
||||
var entityCompanyProp = entry.Properties.FirstOrDefault(p => p.Metadata.Name == "CompanyId");
|
||||
var entityCompanyId = entityCompanyProp?.CurrentValue as int? ?? companyId;
|
||||
|
||||
logs.Add(new AuditLog
|
||||
{
|
||||
UserId = userId,
|
||||
UserName = userName,
|
||||
CompanyId = entityCompanyId,
|
||||
Action = action,
|
||||
EntityType = typeName,
|
||||
EntityId = entityId,
|
||||
EntityDescription = description,
|
||||
OldValues = oldJson,
|
||||
NewValues = newJson,
|
||||
IpAddress = ip,
|
||||
Timestamp = DateTime.UtcNow
|
||||
});
|
||||
}
|
||||
|
||||
return logs;
|
||||
}
|
||||
|
||||
private static string? SerializeProperties(Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues values,
|
||||
Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues? compareAgainst)
|
||||
{
|
||||
var dict = new Dictionary<string, object?>();
|
||||
foreach (var prop in values.Properties)
|
||||
{
|
||||
if (ExcludedProperties.Contains(prop.Name)) continue;
|
||||
var current = values[prop];
|
||||
|
||||
// When comparing, only include changed properties
|
||||
if (compareAgainst != null)
|
||||
{
|
||||
var other = compareAgainst[prop];
|
||||
if (Equals(current, other)) continue;
|
||||
}
|
||||
|
||||
dict[prop.Name] = current;
|
||||
}
|
||||
return dict.Count == 0 ? null : JsonSerializer.Serialize(dict);
|
||||
}
|
||||
|
||||
private static string? GetDescription(Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry entry)
|
||||
{
|
||||
// Try common "name" properties in priority order
|
||||
string[] candidates = ["JobNumber", "QuoteNumber", "InvoiceNumber", "BillNumber", "PaymentNumber",
|
||||
"ReceiptNumber", "CertificateNumber", "Email", "CompanyName", "Name", "EquipmentName", "ItemName"];
|
||||
foreach (var name in candidates)
|
||||
{
|
||||
var prop = entry.Properties.FirstOrDefault(p => p.Metadata.Name == name);
|
||||
if (prop?.CurrentValue is string s && !string.IsNullOrWhiteSpace(s))
|
||||
return s;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// ── Raw SQL insert (bypasses change tracker → no recursion) ─────────────────
|
||||
|
||||
private static void InsertSync(DbContext context, AuditLog log)
|
||||
{
|
||||
context.Database.ExecuteSqlRaw(InsertSql, BuildParams(log));
|
||||
}
|
||||
|
||||
private static async Task InsertAsync(DbContext context, AuditLog log, CancellationToken ct)
|
||||
{
|
||||
await context.Database.ExecuteSqlRawAsync(InsertSql, BuildParams(log), ct);
|
||||
}
|
||||
|
||||
private static SqlParameter[] BuildParams(AuditLog log) =>
|
||||
[
|
||||
new SqlParameter("@userId", SqlDbType.NVarChar, -1) { Value = (object?)log.UserId ?? DBNull.Value },
|
||||
new SqlParameter("@userName", SqlDbType.NVarChar, -1) { Value = (object)log.UserName },
|
||||
new SqlParameter("@companyId", SqlDbType.Int) { Value = (object?)log.CompanyId ?? DBNull.Value },
|
||||
new SqlParameter("@companyName", SqlDbType.NVarChar, -1) { Value = (object?)log.CompanyName ?? DBNull.Value },
|
||||
new SqlParameter("@action", SqlDbType.NVarChar, -1) { Value = (object)log.Action },
|
||||
new SqlParameter("@entityType", SqlDbType.NVarChar, -1) { Value = (object)log.EntityType },
|
||||
new SqlParameter("@entityId", SqlDbType.NVarChar, -1) { Value = (object?)log.EntityId ?? DBNull.Value },
|
||||
new SqlParameter("@entityDescription", SqlDbType.NVarChar, -1) { Value = (object?)log.EntityDescription ?? DBNull.Value },
|
||||
new SqlParameter("@oldValues", SqlDbType.NVarChar, -1) { Value = (object?)log.OldValues ?? DBNull.Value },
|
||||
new SqlParameter("@newValues", SqlDbType.NVarChar, -1) { Value = (object?)log.NewValues ?? DBNull.Value },
|
||||
new SqlParameter("@ipAddress", SqlDbType.NVarChar, -1) { Value = (object?)log.IpAddress ?? DBNull.Value },
|
||||
new SqlParameter("@timestamp", SqlDbType.DateTime2) { Value = (object)log.Timestamp },
|
||||
];
|
||||
|
||||
private const string InsertSql = """
|
||||
INSERT INTO AuditLogs
|
||||
(UserId, UserName, CompanyId, CompanyName, Action, EntityType, EntityId,
|
||||
EntityDescription, OldValues, NewValues, IpAddress, Timestamp)
|
||||
VALUES (@userId, @userName, @companyId, @companyName, @action, @entityType, @entityId,
|
||||
@entityDescription, @oldValues, @newValues, @ipAddress, @timestamp)
|
||||
""";
|
||||
|
||||
// ── Request context helpers ───────────────────────────────────────────────────
|
||||
|
||||
private (string? userId, string userName, int? companyId, string? ip) GetRequestContext()
|
||||
{
|
||||
var ctx = _httpContextAccessor.HttpContext;
|
||||
if (ctx == null) return (null, "System", null, null);
|
||||
|
||||
var user = ctx.User;
|
||||
var userId = user.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value;
|
||||
var userName = user.Identity?.Name ?? user.FindFirst(System.Security.Claims.ClaimTypes.Email)?.Value ?? "Unknown";
|
||||
var companyIdStr = user.FindFirst("CompanyId")?.Value;
|
||||
int? companyId = companyIdStr != null && int.TryParse(companyIdStr, out var cid) ? cid : null;
|
||||
var ip = ctx.Connection.RemoteIpAddress?.ToString();
|
||||
|
||||
return (userId, userName, companyId, ip);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System.Data;
|
||||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PowderCoating.Application.Interfaces;
|
||||
|
||||
namespace PowderCoating.Infrastructure.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Writes manual audit log entries via raw SQL, matching the approach used by
|
||||
/// <see cref="AuditInterceptor"/> so neither path can trigger an infinite loop
|
||||
/// through the EF change tracker.
|
||||
/// </summary>
|
||||
public class AuditService : IAuditService
|
||||
{
|
||||
private readonly ApplicationDbContext _db;
|
||||
private readonly IHttpContextAccessor _http;
|
||||
|
||||
public AuditService(ApplicationDbContext db, IHttpContextAccessor http)
|
||||
{
|
||||
_db = db;
|
||||
_http = http;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task LogAsync(string action, string entityType, string? description = null,
|
||||
object? details = null, string? entityId = null)
|
||||
{
|
||||
var (userId, userName, companyId, ip) = GetRequestContext();
|
||||
var newValues = details != null ? JsonSerializer.Serialize(details) : null;
|
||||
|
||||
const string sql = """
|
||||
INSERT INTO AuditLogs
|
||||
(UserId, UserName, CompanyId, CompanyName, Action, EntityType, EntityId,
|
||||
EntityDescription, OldValues, NewValues, IpAddress, Timestamp)
|
||||
VALUES (@userId, @userName, @companyId, @companyName, @action, @entityType, @entityId,
|
||||
@entityDescription, NULL, @newValues, @ipAddress, @timestamp)
|
||||
""";
|
||||
|
||||
SqlParameter[] p =
|
||||
[
|
||||
new("@userId", SqlDbType.NVarChar, -1) { Value = (object?)userId ?? DBNull.Value },
|
||||
new("@userName", SqlDbType.NVarChar, -1) { Value = (object)userName },
|
||||
new("@companyId", SqlDbType.Int) { Value = (object?)companyId ?? DBNull.Value },
|
||||
new("@companyName", SqlDbType.NVarChar, -1) { Value = DBNull.Value },
|
||||
new("@action", SqlDbType.NVarChar, -1) { Value = (object)action },
|
||||
new("@entityType", SqlDbType.NVarChar, -1) { Value = (object)entityType },
|
||||
new("@entityId", SqlDbType.NVarChar, -1) { Value = (object?)entityId ?? DBNull.Value },
|
||||
new("@entityDescription", SqlDbType.NVarChar, -1) { Value = (object?)description ?? DBNull.Value },
|
||||
new("@newValues", SqlDbType.NVarChar, -1) { Value = (object?)newValues ?? DBNull.Value },
|
||||
new("@ipAddress", SqlDbType.NVarChar, -1) { Value = (object?)ip ?? DBNull.Value },
|
||||
new("@timestamp", SqlDbType.DateTime2) { Value = DateTime.UtcNow },
|
||||
];
|
||||
|
||||
await _db.Database.ExecuteSqlRawAsync(sql, p);
|
||||
}
|
||||
|
||||
private (string? userId, string userName, int? companyId, string? ip) GetRequestContext()
|
||||
{
|
||||
var ctx = _http.HttpContext;
|
||||
if (ctx == null) return (null, "System", null, null);
|
||||
|
||||
var user = ctx.User;
|
||||
var userId = user.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value;
|
||||
var userName = user.Identity?.Name
|
||||
?? user.FindFirst(System.Security.Claims.ClaimTypes.Email)?.Value
|
||||
?? "Unknown";
|
||||
var cidStr = user.FindFirst("CompanyId")?.Value;
|
||||
int? companyId = cidStr != null && int.TryParse(cidStr, out var c) ? c : null;
|
||||
var ip = ctx.Connection.RemoteIpAddress?.ToString();
|
||||
|
||||
return (userId, userName, companyId, ip);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Options;
|
||||
using PowderCoating.Core.Entities;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace PowderCoating.Infrastructure.Identity;
|
||||
|
||||
/// <summary>
|
||||
/// Custom ASP.NET Core Identity claims factory that embeds application-specific claims into the
|
||||
/// user's <see cref="ClaimsPrincipal"/> at login time.
|
||||
/// <para>
|
||||
/// Registered in <c>Program.cs</c> via
|
||||
/// <c>builder.Services.AddScoped<IUserClaimsPrincipalFactory<ApplicationUser>, CustomUserClaimsPrincipalFactory>()</c>
|
||||
/// so that ASP.NET Core Identity calls it instead of the default factory whenever a cookie is issued.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>Why embed claims at login?</b> Reading <c>CompanyId</c> or <c>CompanyRole</c> from the database
|
||||
/// on every request would add a synchronous DB round-trip to the authentication middleware, which runs
|
||||
/// on every single HTTP request. Embedding the values as signed cookie claims at login time means
|
||||
/// subsequent requests are verified cryptographically with zero extra DB queries.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Claims added:
|
||||
/// <list type="bullet">
|
||||
/// <item><description><c>"CompanyId"</c> — the integer ID of the company the user belongs to. Read by <see cref="Data.ApplicationDbContext.CurrentCompanyId"/> to enforce multi-tenancy query filters.</description></item>
|
||||
/// <item><description><c>"CompanyRole"</c> — the user's role within their company (e.g., CompanyAdmin, Manager, Worker). Distinct from the ASP.NET Identity system role (SuperAdmin).</description></item>
|
||||
/// </list>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class CustomUserClaimsPrincipalFactory : UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialises the factory with the Identity infrastructure services required by the base class.
|
||||
/// </summary>
|
||||
/// <param name="userManager">Used by the base class to load user-level claims.</param>
|
||||
/// <param name="roleManager">Used by the base class to load role-level claims.</param>
|
||||
/// <param name="options">Identity options, including the claim-type mappings used by the base class.</param>
|
||||
public CustomUserClaimsPrincipalFactory(
|
||||
UserManager<ApplicationUser> userManager,
|
||||
RoleManager<IdentityRole> roleManager,
|
||||
IOptions<IdentityOptions> options)
|
||||
: base(userManager, roleManager, options)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates the <see cref="ClaimsIdentity"/> for <paramref name="user"/> by first calling the base
|
||||
/// implementation (which adds standard Identity claims such as NameIdentifier, Email, and Role) and
|
||||
/// then appending the application-specific <c>CompanyId</c> and <c>CompanyRole</c> claims.
|
||||
/// <para>
|
||||
/// Each claim addition is wrapped in an individual try/catch to ensure that a missing or malformed
|
||||
/// value on one field does not fail the entire authentication flow — the user is logged in with
|
||||
/// whatever valid claims could be assembled. Errors are written to the debug output rather than
|
||||
/// thrown so that login remains functional even in degraded configurations.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="user">The authenticated <see cref="ApplicationUser"/> whose claims are being constructed.</param>
|
||||
/// <returns>A <see cref="ClaimsIdentity"/> containing all standard and application-specific claims.</returns>
|
||||
protected override async Task<ClaimsIdentity> GenerateClaimsAsync(ApplicationUser user)
|
||||
{
|
||||
var identity = await base.GenerateClaimsAsync(user);
|
||||
|
||||
// Add CompanyId claim - only if valid
|
||||
if (user.CompanyId > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
identity.AddClaim(new Claim("CompanyId", user.CompanyId.ToString()));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Log but don't fail authentication
|
||||
System.Diagnostics.Debug.WriteLine($"Error adding CompanyId claim: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Add CompanyRole claim - only if valid and not empty
|
||||
if (!string.IsNullOrWhiteSpace(user.CompanyRole))
|
||||
{
|
||||
try
|
||||
{
|
||||
// Sanitize the role value to ensure it's safe
|
||||
var sanitizedRole = user.CompanyRole.Trim();
|
||||
identity.AddClaim(new Claim("CompanyRole", sanitizedRole));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Log but don't fail authentication
|
||||
System.Diagnostics.Debug.WriteLine($"Error adding CompanyRole claim: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return identity;
|
||||
}
|
||||
}
|
||||
+7021
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Baseline : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 15, 49, 58, 737, DateTimeKind.Utc).AddTicks(7851));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 15, 49, 58, 737, DateTimeKind.Utc).AddTicks(7856));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 15, 49, 58, 737, DateTimeKind.Utc).AddTicks(7858));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 14, 27, 16, 805, DateTimeKind.Utc).AddTicks(2839));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 14, 27, 16, 805, DateTimeKind.Utc).AddTicks(2845));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 14, 27, 16, 805, DateTimeKind.Utc).AddTicks(2846));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+7025
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddAiContextProfile : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AiContextProfile",
|
||||
table: "CompanyOperatingCosts",
|
||||
type: "nvarchar(2000)",
|
||||
maxLength: 2000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 12, 19, 34, 489, DateTimeKind.Utc).AddTicks(4690));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 12, 19, 34, 489, DateTimeKind.Utc).AddTicks(4696));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 12, 19, 34, 489, DateTimeKind.Utc).AddTicks(4698));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AiContextProfile",
|
||||
table: "CompanyOperatingCosts");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 15, 49, 58, 737, DateTimeKind.Utc).AddTicks(7851));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 15, 49, 58, 737, DateTimeKind.Utc).AddTicks(7856));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 16, 15, 49, 58, 737, DateTimeKind.Utc).AddTicks(7858));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+7025
File diff suppressed because it is too large
Load Diff
+93
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixLaborItemQuantityDecimal : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Quantity",
|
||||
table: "QuoteItems",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Quantity",
|
||||
table: "JobItems",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3737));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3746));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3748));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Quantity",
|
||||
table: "QuoteItems",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Quantity",
|
||||
table: "JobItems",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 12, 19, 34, 489, DateTimeKind.Utc).AddTicks(4690));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 12, 19, 34, 489, DateTimeKind.Utc).AddTicks(4696));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 12, 19, 34, 489, DateTimeKind.Utc).AddTicks(4698));
|
||||
}
|
||||
}
|
||||
}
|
||||
+7107
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobTimeEntries : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobTimeEntries",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
JobId = table.Column<int>(type: "int", nullable: false),
|
||||
ShopWorkerId = table.Column<int>(type: "int", nullable: false),
|
||||
WorkDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
HoursWorked = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
Stage = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobTimeEntries", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTimeEntries_Jobs_JobId",
|
||||
column: x => x.JobId,
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTimeEntries_ShopWorkers_ShopWorkerId",
|
||||
column: x => x.ShopWorkerId,
|
||||
principalTable: "ShopWorkers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2691));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2697));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2699));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTimeEntries_JobId",
|
||||
table: "JobTimeEntries",
|
||||
column: "JobId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTimeEntries_ShopWorkerId",
|
||||
table: "JobTimeEntries",
|
||||
column: "ShopWorkerId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobTimeEntries");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3737));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3746));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 17, 20, 59, 24, 246, DateTimeKind.Utc).AddTicks(3748));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+7116
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobShopAccessCode : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ShopAccessCode",
|
||||
table: "Jobs",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValueSql: "NEWID()");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 14, 57, 220, DateTimeKind.Utc).AddTicks(3832));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 14, 57, 220, DateTimeKind.Utc).AddTicks(3838));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 14, 57, 220, DateTimeKind.Utc).AddTicks(3839));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Jobs_ShopAccessCode",
|
||||
table: "Jobs",
|
||||
column: "ShopAccessCode",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Jobs_ShopAccessCode",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShopAccessCode",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2691));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2697));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 12, 48, 44, 746, DateTimeKind.Utc).AddTicks(2699));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+7163
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddShopWorkerRoleCosts : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ShopWorkerRoleCosts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Role = table.Column<int>(type: "int", nullable: false),
|
||||
HourlyRate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ShopWorkerRoleCosts", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 28, 54, 685, DateTimeKind.Utc).AddTicks(4802));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 28, 54, 685, DateTimeKind.Utc).AddTicks(4849));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 28, 54, 685, DateTimeKind.Utc).AddTicks(4851));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ShopWorkerRoleCosts_CompanyId_Role",
|
||||
table: "ShopWorkerRoleCosts",
|
||||
columns: new[] { "CompanyId", "Role" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ShopWorkerRoleCosts");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 14, 57, 220, DateTimeKind.Utc).AddTicks(3832));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 14, 57, 220, DateTimeKind.Utc).AddTicks(3838));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 14, 57, 220, DateTimeKind.Utc).AddTicks(3839));
|
||||
}
|
||||
}
|
||||
}
|
||||
+7300
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddReworkTracking : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsReworkJob",
|
||||
table: "Jobs",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "OriginalJobId",
|
||||
table: "Jobs",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ReworkRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
JobId = table.Column<int>(type: "int", nullable: false),
|
||||
JobItemId = table.Column<int>(type: "int", nullable: true),
|
||||
ReworkJobId = table.Column<int>(type: "int", nullable: true),
|
||||
ReworkType = table.Column<int>(type: "int", nullable: false),
|
||||
Reason = table.Column<int>(type: "int", nullable: false),
|
||||
DefectDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DiscoveredBy = table.Column<int>(type: "int", nullable: false),
|
||||
DiscoveredDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ReportedByName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
EstimatedReworkCost = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
ActualReworkCost = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
IsBillableToCustomer = table.Column<bool>(type: "bit", nullable: false),
|
||||
BillingNotes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Resolution = table.Column<int>(type: "int", nullable: true),
|
||||
ResolvedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
ResolutionNotes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ReworkRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ReworkRecords_JobItems_JobItemId",
|
||||
column: x => x.JobItemId,
|
||||
principalTable: "JobItems",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_ReworkRecords_Jobs_JobId",
|
||||
column: x => x.JobId,
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_ReworkRecords_Jobs_ReworkJobId",
|
||||
column: x => x.ReworkJobId,
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 42, 32, 909, DateTimeKind.Utc).AddTicks(2998));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 42, 32, 909, DateTimeKind.Utc).AddTicks(3003));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 42, 32, 909, DateTimeKind.Utc).AddTicks(3005));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Jobs_OriginalJobId",
|
||||
table: "Jobs",
|
||||
column: "OriginalJobId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ReworkRecords_JobId",
|
||||
table: "ReworkRecords",
|
||||
column: "JobId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ReworkRecords_JobItemId",
|
||||
table: "ReworkRecords",
|
||||
column: "JobItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ReworkRecords_ReworkJobId",
|
||||
table: "ReworkRecords",
|
||||
column: "ReworkJobId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Jobs_Jobs_OriginalJobId",
|
||||
table: "Jobs",
|
||||
column: "OriginalJobId",
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Jobs_Jobs_OriginalJobId",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ReworkRecords");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Jobs_OriginalJobId",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsReworkJob",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OriginalJobId",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 28, 54, 685, DateTimeKind.Utc).AddTicks(4802));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 28, 54, 685, DateTimeKind.Utc).AddTicks(4849));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 28, 54, 685, DateTimeKind.Utc).AddTicks(4851));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+7617
File diff suppressed because it is too large
Load Diff
+290
@@ -0,0 +1,290 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddRefundsAndCreditMemos : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "CreditApplied",
|
||||
table: "Invoices",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "CreditBalance",
|
||||
table: "Customers",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CreditMemos",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
MemoNumber = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
CustomerId = table.Column<int>(type: "int", nullable: false),
|
||||
OriginalInvoiceId = table.Column<int>(type: "int", nullable: true),
|
||||
ReworkRecordId = table.Column<int>(type: "int", nullable: true),
|
||||
Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
AmountApplied = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
IssueDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ExpiryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Reason = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
IssuedById = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CreditMemos", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemos_AspNetUsers_IssuedById",
|
||||
column: x => x.IssuedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemos_Customers_CustomerId",
|
||||
column: x => x.CustomerId,
|
||||
principalTable: "Customers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemos_Invoices_OriginalInvoiceId",
|
||||
column: x => x.OriginalInvoiceId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemos_ReworkRecords_ReworkRecordId",
|
||||
column: x => x.ReworkRecordId,
|
||||
principalTable: "ReworkRecords",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Refunds",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
InvoiceId = table.Column<int>(type: "int", nullable: false),
|
||||
PaymentId = table.Column<int>(type: "int", nullable: true),
|
||||
Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
RefundDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
RefundMethod = table.Column<int>(type: "int", nullable: false),
|
||||
Reason = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Reference = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
IssuedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IssuedById = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Refunds", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Refunds_AspNetUsers_IssuedById",
|
||||
column: x => x.IssuedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Refunds_Invoices_InvoiceId",
|
||||
column: x => x.InvoiceId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Refunds_Payments_PaymentId",
|
||||
column: x => x.PaymentId,
|
||||
principalTable: "Payments",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CreditMemoApplications",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CreditMemoId = table.Column<int>(type: "int", nullable: false),
|
||||
InvoiceId = table.Column<int>(type: "int", nullable: false),
|
||||
AmountApplied = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
AppliedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
AppliedById = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CreditMemoApplications", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemoApplications_AspNetUsers_AppliedById",
|
||||
column: x => x.AppliedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemoApplications_CreditMemos_CreditMemoId",
|
||||
column: x => x.CreditMemoId,
|
||||
principalTable: "CreditMemos",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_CreditMemoApplications_Invoices_InvoiceId",
|
||||
column: x => x.InvoiceId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 22, 26, 44, 934, DateTimeKind.Utc).AddTicks(9567));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 22, 26, 44, 934, DateTimeKind.Utc).AddTicks(9573));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 22, 26, 44, 934, DateTimeKind.Utc).AddTicks(9575));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemoApplications_AppliedById",
|
||||
table: "CreditMemoApplications",
|
||||
column: "AppliedById");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemoApplications_CreditMemoId",
|
||||
table: "CreditMemoApplications",
|
||||
column: "CreditMemoId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemoApplications_InvoiceId",
|
||||
table: "CreditMemoApplications",
|
||||
column: "InvoiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemos_CompanyId_MemoNumber",
|
||||
table: "CreditMemos",
|
||||
columns: new[] { "CompanyId", "MemoNumber" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemos_CustomerId",
|
||||
table: "CreditMemos",
|
||||
column: "CustomerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemos_IssuedById",
|
||||
table: "CreditMemos",
|
||||
column: "IssuedById");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemos_OriginalInvoiceId",
|
||||
table: "CreditMemos",
|
||||
column: "OriginalInvoiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CreditMemos_ReworkRecordId",
|
||||
table: "CreditMemos",
|
||||
column: "ReworkRecordId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Refunds_InvoiceId",
|
||||
table: "Refunds",
|
||||
column: "InvoiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Refunds_IssuedById",
|
||||
table: "Refunds",
|
||||
column: "IssuedById");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Refunds_PaymentId",
|
||||
table: "Refunds",
|
||||
column: "PaymentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CreditMemoApplications");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Refunds");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CreditMemos");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreditApplied",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreditBalance",
|
||||
table: "Customers");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 42, 32, 909, DateTimeKind.Utc).AddTicks(2998));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 42, 32, 909, DateTimeKind.Utc).AddTicks(3003));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 13, 42, 32, 909, DateTimeKind.Utc).AddTicks(3005));
|
||||
}
|
||||
}
|
||||
}
|
||||
+7972
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,273 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobTemplates : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobTemplates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CustomerId = table.Column<int>(type: "int", nullable: true),
|
||||
SpecialInstructions = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
||||
UsageCount = table.Column<int>(type: "int", nullable: false),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobTemplates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplates_Customers_CustomerId",
|
||||
column: x => x.CustomerId,
|
||||
principalTable: "Customers",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobTemplateItems",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
JobTemplateId = table.Column<int>(type: "int", nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Quantity = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
SurfaceAreaSqFt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
CatalogItemId = table.Column<int>(type: "int", nullable: true),
|
||||
IsGenericItem = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsLaborItem = table.Column<bool>(type: "bit", nullable: false),
|
||||
ManualUnitPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
||||
RequiresSandblasting = table.Column<bool>(type: "bit", nullable: false),
|
||||
RequiresMasking = table.Column<bool>(type: "bit", nullable: false),
|
||||
IncludePrepCost = table.Column<bool>(type: "bit", nullable: false),
|
||||
EstimatedMinutes = table.Column<int>(type: "int", nullable: false),
|
||||
Complexity = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DisplayOrder = table.Column<int>(type: "int", nullable: false),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobTemplateItems", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItems_CatalogItems_CatalogItemId",
|
||||
column: x => x.CatalogItemId,
|
||||
principalTable: "CatalogItems",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItems_JobTemplates_JobTemplateId",
|
||||
column: x => x.JobTemplateId,
|
||||
principalTable: "JobTemplates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobTemplateItemCoats",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
JobTemplateItemId = table.Column<int>(type: "int", nullable: false),
|
||||
CoatName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Sequence = table.Column<int>(type: "int", nullable: false),
|
||||
InventoryItemId = table.Column<int>(type: "int", nullable: true),
|
||||
ColorName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
VendorId = table.Column<int>(type: "int", nullable: true),
|
||||
ColorCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Finish = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CoverageSqFtPerLb = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
TransferEfficiency = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
PowderCostPerLb = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobTemplateItemCoats", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItemCoats_InventoryItems_InventoryItemId",
|
||||
column: x => x.InventoryItemId,
|
||||
principalTable: "InventoryItems",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItemCoats_JobTemplateItems_JobTemplateItemId",
|
||||
column: x => x.JobTemplateItemId,
|
||||
principalTable: "JobTemplateItems",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItemCoats_Vendors_VendorId",
|
||||
column: x => x.VendorId,
|
||||
principalTable: "Vendors",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobTemplateItemPrepServices",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
JobTemplateItemId = table.Column<int>(type: "int", nullable: false),
|
||||
PrepServiceId = table.Column<int>(type: "int", nullable: false),
|
||||
EstimatedMinutes = table.Column<int>(type: "int", nullable: false),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobTemplateItemPrepServices", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItemPrepServices_JobTemplateItems_JobTemplateItemId",
|
||||
column: x => x.JobTemplateItemId,
|
||||
principalTable: "JobTemplateItems",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobTemplateItemPrepServices_PrepServices_PrepServiceId",
|
||||
column: x => x.PrepServiceId,
|
||||
principalTable: "PrepServices",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 2, 38, 23, 419, DateTimeKind.Utc).AddTicks(5291));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 2, 38, 23, 419, DateTimeKind.Utc).AddTicks(5296));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 2, 38, 23, 419, DateTimeKind.Utc).AddTicks(5298));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItemCoats_InventoryItemId",
|
||||
table: "JobTemplateItemCoats",
|
||||
column: "InventoryItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItemCoats_JobTemplateItemId",
|
||||
table: "JobTemplateItemCoats",
|
||||
column: "JobTemplateItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItemCoats_VendorId",
|
||||
table: "JobTemplateItemCoats",
|
||||
column: "VendorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItemPrepServices_JobTemplateItemId",
|
||||
table: "JobTemplateItemPrepServices",
|
||||
column: "JobTemplateItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItemPrepServices_PrepServiceId",
|
||||
table: "JobTemplateItemPrepServices",
|
||||
column: "PrepServiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItems_CatalogItemId",
|
||||
table: "JobTemplateItems",
|
||||
column: "CatalogItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplateItems_JobTemplateId",
|
||||
table: "JobTemplateItems",
|
||||
column: "JobTemplateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobTemplates_CustomerId",
|
||||
table: "JobTemplates",
|
||||
column: "CustomerId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobTemplateItemCoats");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobTemplateItemPrepServices");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobTemplateItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobTemplates");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 22, 26, 44, 934, DateTimeKind.Utc).AddTicks(9567));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 22, 26, 44, 934, DateTimeKind.Utc).AddTicks(9573));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 18, 22, 26, 44, 934, DateTimeKind.Utc).AddTicks(9575));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8172
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,199 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddGiftCertificates : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "GiftCertificateRedeemed",
|
||||
table: "Invoices",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GiftCertificates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CertificateCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
OriginalAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
RedeemedAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
RecipientCustomerId = table.Column<int>(type: "int", nullable: true),
|
||||
RecipientName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
RecipientEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IssuedReason = table.Column<int>(type: "int", nullable: false),
|
||||
PurchasePrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
||||
PurchasingCustomerId = table.Column<int>(type: "int", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
IssueDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ExpiryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IssuedById = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GiftCertificates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GiftCertificates_AspNetUsers_IssuedById",
|
||||
column: x => x.IssuedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_GiftCertificates_Customers_PurchasingCustomerId",
|
||||
column: x => x.PurchasingCustomerId,
|
||||
principalTable: "Customers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_GiftCertificates_Customers_RecipientCustomerId",
|
||||
column: x => x.RecipientCustomerId,
|
||||
principalTable: "Customers",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GiftCertificateRedemptions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
GiftCertificateId = table.Column<int>(type: "int", nullable: false),
|
||||
InvoiceId = table.Column<int>(type: "int", nullable: false),
|
||||
AmountRedeemed = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
RedeemedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
RedeemedById = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GiftCertificateRedemptions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GiftCertificateRedemptions_AspNetUsers_RedeemedById",
|
||||
column: x => x.RedeemedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_GiftCertificateRedemptions_GiftCertificates_GiftCertificateId",
|
||||
column: x => x.GiftCertificateId,
|
||||
principalTable: "GiftCertificates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_GiftCertificateRedemptions_Invoices_InvoiceId",
|
||||
column: x => x.InvoiceId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4465));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4472));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4474));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificateRedemptions_GiftCertificateId",
|
||||
table: "GiftCertificateRedemptions",
|
||||
column: "GiftCertificateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificateRedemptions_InvoiceId",
|
||||
table: "GiftCertificateRedemptions",
|
||||
column: "InvoiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificateRedemptions_RedeemedById",
|
||||
table: "GiftCertificateRedemptions",
|
||||
column: "RedeemedById");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificates_IssuedById",
|
||||
table: "GiftCertificates",
|
||||
column: "IssuedById");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificates_PurchasingCustomerId",
|
||||
table: "GiftCertificates",
|
||||
column: "PurchasingCustomerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificates_RecipientCustomerId",
|
||||
table: "GiftCertificates",
|
||||
column: "RecipientCustomerId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GiftCertificateRedemptions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GiftCertificates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GiftCertificateRedeemed",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 2, 38, 23, 419, DateTimeKind.Utc).AddTicks(5291));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 2, 38, 23, 419, DateTimeKind.Utc).AddTicks(5296));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 2, 38, 23, 419, DateTimeKind.Utc).AddTicks(5298));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8183
File diff suppressed because it is too large
Load Diff
+91
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddRefundStoreCreditLink : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CreditMemoId",
|
||||
table: "Refunds",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1509));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1518));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1521));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Refunds_CreditMemoId",
|
||||
table: "Refunds",
|
||||
column: "CreditMemoId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Refunds_CreditMemos_CreditMemoId",
|
||||
table: "Refunds",
|
||||
column: "CreditMemoId",
|
||||
principalTable: "CreditMemos",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Refunds_CreditMemos_CreditMemoId",
|
||||
table: "Refunds");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Refunds_CreditMemoId",
|
||||
table: "Refunds");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreditMemoId",
|
||||
table: "Refunds");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4465));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4472));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 19, 15, 45, 3, 145, DateTimeKind.Utc).AddTicks(4474));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8186
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddQuoteItemIsAiItem : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAiItem",
|
||||
table: "QuoteItems",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 51, 3, 242, DateTimeKind.Utc).AddTicks(3766));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 51, 3, 242, DateTimeKind.Utc).AddTicks(3772));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 51, 3, 242, DateTimeKind.Utc).AddTicks(3774));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAiItem",
|
||||
table: "QuoteItems");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1509));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1518));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 24, 47, 361, DateTimeKind.Utc).AddTicks(1521));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8210
File diff suppressed because it is too large
Load Diff
+149
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddQuotePricingSnapshot : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ItemsSubtotal",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "OvenBatchCost",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "OverheadAmount",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "OverheadPercent",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ProfitMargin",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ProfitPercent",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ShopSuppliesAmount",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "ShopSuppliesPercent",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 1, 10, 54, 146, DateTimeKind.Utc).AddTicks(8159));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 1, 10, 54, 146, DateTimeKind.Utc).AddTicks(8166));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 1, 10, 54, 146, DateTimeKind.Utc).AddTicks(8176));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ItemsSubtotal",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OvenBatchCost",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OverheadAmount",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OverheadPercent",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProfitMargin",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ProfitPercent",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShopSuppliesAmount",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShopSuppliesPercent",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 51, 3, 242, DateTimeKind.Utc).AddTicks(3766));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 51, 3, 242, DateTimeKind.Utc).AddTicks(3772));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 0, 51, 3, 242, DateTimeKind.Utc).AddTicks(3774));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8252
File diff suppressed because it is too large
Load Diff
+211
@@ -0,0 +1,211 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddStripeConnectAndOnlinePayments : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AllowOnlinePayments",
|
||||
table: "SubscriptionPlanConfigs",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "DepositPercent",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "RequiresDeposit",
|
||||
table: "Quotes",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "OnlineAmountPaid",
|
||||
table: "Invoices",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "OnlinePaymentStatus",
|
||||
table: "Invoices",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "OnlineSurchargeCollected",
|
||||
table: "Invoices",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "PaymentLinkExpiresAt",
|
||||
table: "Invoices",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "PaymentLinkToken",
|
||||
table: "Invoices",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "StripePaymentIntentId",
|
||||
table: "Invoices",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "OnlinePaymentSurchargeType",
|
||||
table: "Companies",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "OnlinePaymentSurchargeValue",
|
||||
table: "Companies",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "OnlineSurchargeAcknowledged",
|
||||
table: "Companies",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "StripeAccountId",
|
||||
table: "Companies",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "StripeConnectStatus",
|
||||
table: "Companies",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 23, 15, 5, 688, DateTimeKind.Utc).AddTicks(6302));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 23, 15, 5, 688, DateTimeKind.Utc).AddTicks(6308));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 23, 15, 5, 688, DateTimeKind.Utc).AddTicks(6310));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowOnlinePayments",
|
||||
table: "SubscriptionPlanConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DepositPercent",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RequiresDeposit",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlineAmountPaid",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlinePaymentStatus",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlineSurchargeCollected",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaymentLinkExpiresAt",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaymentLinkToken",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StripePaymentIntentId",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlinePaymentSurchargeType",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlinePaymentSurchargeValue",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlineSurchargeAcknowledged",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StripeAccountId",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StripeConnectStatus",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 1, 10, 54, 146, DateTimeKind.Utc).AddTicks(8159));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 1, 10, 54, 146, DateTimeKind.Utc).AddTicks(8166));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 1, 10, 54, 146, DateTimeKind.Utc).AddTicks(8176));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8258
File diff suppressed because it is too large
Load Diff
+82
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddQuotePhotoSubscriptionLimits : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxQuotePhotos",
|
||||
table: "SubscriptionPlanConfigs",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxQuotePhotosOverride",
|
||||
table: "Companies",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 26, 23, 4, 35, 135, DateTimeKind.Utc).AddTicks(3265));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 26, 23, 4, 35, 135, DateTimeKind.Utc).AddTicks(3273));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 26, 23, 4, 35, 135, DateTimeKind.Utc).AddTicks(3275));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxQuotePhotos",
|
||||
table: "SubscriptionPlanConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxQuotePhotosOverride",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 23, 15, 5, 688, DateTimeKind.Utc).AddTicks(6302));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 23, 15, 5, 688, DateTimeKind.Utc).AddTicks(6308));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 20, 23, 15, 5, 688, DateTimeKind.Utc).AddTicks(6310));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8258
File diff suppressed because it is too large
Load Diff
+61
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobPhotoIsAiAnalysisPhoto : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 28, 13, 36, 24, 154, DateTimeKind.Utc).AddTicks(8411));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 28, 13, 36, 24, 154, DateTimeKind.Utc).AddTicks(8419));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 28, 13, 36, 24, 154, DateTimeKind.Utc).AddTicks(8421));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 26, 23, 4, 35, 135, DateTimeKind.Utc).AddTicks(3265));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 26, 23, 4, 35, 135, DateTimeKind.Utc).AddTicks(3273));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 26, 23, 4, 35, 135, DateTimeKind.Utc).AddTicks(3275));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8273
File diff suppressed because it is too large
Load Diff
+115
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobDiscountRushFields : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DiscountReason",
|
||||
table: "Jobs",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "DiscountType",
|
||||
table: "Jobs",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "DiscountValue",
|
||||
table: "Jobs",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsRushJob",
|
||||
table: "Jobs",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAiAnalysisPhoto",
|
||||
table: "JobPhotos",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 32, 56, 736, DateTimeKind.Utc).AddTicks(8710));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 32, 56, 736, DateTimeKind.Utc).AddTicks(8717));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 32, 56, 736, DateTimeKind.Utc).AddTicks(8718));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DiscountReason",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DiscountType",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DiscountValue",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsRushJob",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAiAnalysisPhoto",
|
||||
table: "JobPhotos");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 28, 13, 36, 24, 154, DateTimeKind.Utc).AddTicks(8411));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 28, 13, 36, 24, 154, DateTimeKind.Utc).AddTicks(8419));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 28, 13, 36, 24, 154, DateTimeKind.Utc).AddTicks(8421));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8393
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddDeposits : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Deposits",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ReceiptNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CustomerId = table.Column<int>(type: "int", nullable: false),
|
||||
JobId = table.Column<int>(type: "int", nullable: true),
|
||||
QuoteId = table.Column<int>(type: "int", nullable: true),
|
||||
Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||||
PaymentMethod = table.Column<int>(type: "int", nullable: false),
|
||||
ReceivedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Reference = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
RecordedById = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
AppliedToInvoiceId = table.Column<int>(type: "int", nullable: true),
|
||||
AppliedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Deposits", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Deposits_AspNetUsers_RecordedById",
|
||||
column: x => x.RecordedById,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Deposits_Customers_CustomerId",
|
||||
column: x => x.CustomerId,
|
||||
principalTable: "Customers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Deposits_Invoices_AppliedToInvoiceId",
|
||||
column: x => x.AppliedToInvoiceId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
table.ForeignKey(
|
||||
name: "FK_Deposits_Jobs_JobId",
|
||||
column: x => x.JobId,
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Deposits_Quotes_QuoteId",
|
||||
column: x => x.QuoteId,
|
||||
principalTable: "Quotes",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 58, 35, 757, DateTimeKind.Utc).AddTicks(6949));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 58, 35, 757, DateTimeKind.Utc).AddTicks(6955));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 58, 35, 757, DateTimeKind.Utc).AddTicks(6957));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Deposits_AppliedToInvoiceId",
|
||||
table: "Deposits",
|
||||
column: "AppliedToInvoiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Deposits_CustomerId",
|
||||
table: "Deposits",
|
||||
column: "CustomerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Deposits_JobId",
|
||||
table: "Deposits",
|
||||
column: "JobId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Deposits_QuoteId",
|
||||
table: "Deposits",
|
||||
column: "QuoteId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Deposits_RecordedById",
|
||||
table: "Deposits",
|
||||
column: "RecordedById");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Deposits");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 32, 56, 736, DateTimeKind.Utc).AddTicks(8710));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 32, 56, 736, DateTimeKind.Utc).AddTicks(8717));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 32, 56, 736, DateTimeKind.Utc).AddTicks(8718));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8422
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,203 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddMerchandise : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Invoices_CompanyId_JobId",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Invoices_JobId",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "JobId",
|
||||
table: "Invoices",
|
||||
type: "int",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CatalogItemId",
|
||||
table: "InvoiceItems",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "InventoryItemId",
|
||||
table: "CatalogItems",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsMerchandise",
|
||||
table: "CatalogItems",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsMerchandise",
|
||||
table: "CatalogCategories",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 13, 47, 49, 417, DateTimeKind.Utc).AddTicks(6542));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 13, 47, 49, 417, DateTimeKind.Utc).AddTicks(6549));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 13, 47, 49, 417, DateTimeKind.Utc).AddTicks(6551));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_CompanyId_JobId",
|
||||
table: "Invoices",
|
||||
columns: new[] { "CompanyId", "JobId" },
|
||||
unique: true,
|
||||
filter: "[JobId] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_JobId",
|
||||
table: "Invoices",
|
||||
column: "JobId",
|
||||
unique: true,
|
||||
filter: "[JobId] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InvoiceItems_CatalogItemId",
|
||||
table: "InvoiceItems",
|
||||
column: "CatalogItemId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CatalogItems_InventoryItemId",
|
||||
table: "CatalogItems",
|
||||
column: "InventoryItemId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CatalogItems_InventoryItems_InventoryItemId",
|
||||
table: "CatalogItems",
|
||||
column: "InventoryItemId",
|
||||
principalTable: "InventoryItems",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InvoiceItems_CatalogItems_CatalogItemId",
|
||||
table: "InvoiceItems",
|
||||
column: "CatalogItemId",
|
||||
principalTable: "CatalogItems",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_CatalogItems_InventoryItems_InventoryItemId",
|
||||
table: "CatalogItems");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InvoiceItems_CatalogItems_CatalogItemId",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Invoices_CompanyId_JobId",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Invoices_JobId",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InvoiceItems_CatalogItemId",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_CatalogItems_InventoryItemId",
|
||||
table: "CatalogItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CatalogItemId",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "InventoryItemId",
|
||||
table: "CatalogItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsMerchandise",
|
||||
table: "CatalogItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsMerchandise",
|
||||
table: "CatalogCategories");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "JobId",
|
||||
table: "Invoices",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 58, 35, 757, DateTimeKind.Utc).AddTicks(6949));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 58, 35, 757, DateTimeKind.Utc).AddTicks(6955));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 0, 58, 35, 757, DateTimeKind.Utc).AddTicks(6957));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_CompanyId_JobId",
|
||||
table: "Invoices",
|
||||
columns: new[] { "CompanyId", "JobId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_JobId",
|
||||
table: "Invoices",
|
||||
column: "JobId",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8448
File diff suppressed because it is too large
Load Diff
+142
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddGiftCertificateInvoiceItems : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "GcExpiryDate",
|
||||
table: "InvoiceItems",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "GcRecipientEmail",
|
||||
table: "InvoiceItems",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "GcRecipientName",
|
||||
table: "InvoiceItems",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "GeneratedGiftCertificateId",
|
||||
table: "InvoiceItems",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsGiftCertificate",
|
||||
table: "InvoiceItems",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "SourceInvoiceItemId",
|
||||
table: "GiftCertificates",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 14, 11, 34, 230, DateTimeKind.Utc).AddTicks(5437));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 14, 11, 34, 230, DateTimeKind.Utc).AddTicks(5443));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 14, 11, 34, 230, DateTimeKind.Utc).AddTicks(5445));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InvoiceItems_GeneratedGiftCertificateId",
|
||||
table: "InvoiceItems",
|
||||
column: "GeneratedGiftCertificateId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_InvoiceItems_GiftCertificates_GeneratedGiftCertificateId",
|
||||
table: "InvoiceItems",
|
||||
column: "GeneratedGiftCertificateId",
|
||||
principalTable: "GiftCertificates",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_InvoiceItems_GiftCertificates_GeneratedGiftCertificateId",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InvoiceItems_GeneratedGiftCertificateId",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GcExpiryDate",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GcRecipientEmail",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GcRecipientName",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GeneratedGiftCertificateId",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsGiftCertificate",
|
||||
table: "InvoiceItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SourceInvoiceItemId",
|
||||
table: "GiftCertificates");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 13, 47, 49, 417, DateTimeKind.Utc).AddTicks(6542));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 13, 47, 49, 417, DateTimeKind.Utc).AddTicks(6549));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 13, 47, 49, 417, DateTimeKind.Utc).AddTicks(6551));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8460
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSalesItemFields : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsSalesItem",
|
||||
table: "QuoteItems",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Sku",
|
||||
table: "QuoteItems",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsSalesItem",
|
||||
table: "JobItems",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Sku",
|
||||
table: "JobItems",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 30, 23, 40, 30, 148, DateTimeKind.Utc).AddTicks(3162));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 30, 23, 40, 30, 148, DateTimeKind.Utc).AddTicks(3168));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 30, 23, 40, 30, 148, DateTimeKind.Utc).AddTicks(3170));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsSalesItem",
|
||||
table: "QuoteItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Sku",
|
||||
table: "QuoteItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsSalesItem",
|
||||
table: "JobItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Sku",
|
||||
table: "JobItems");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 14, 11, 34, 230, DateTimeKind.Utc).AddTicks(5437));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 14, 11, 34, 230, DateTimeKind.Utc).AddTicks(5443));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 29, 14, 11, 34, 230, DateTimeKind.Utc).AddTicks(5445));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8472
File diff suppressed because it is too large
Load Diff
+102
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddQuoteDepositPaymentFields : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "DepositAmountPaid",
|
||||
table: "Quotes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DepositPaymentIntentId",
|
||||
table: "Quotes",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DepositPaymentLinkExpiresAt",
|
||||
table: "Quotes",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DepositPaymentLinkToken",
|
||||
table: "Quotes",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 12, 56, 27, 180, DateTimeKind.Utc).AddTicks(8248));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 12, 56, 27, 180, DateTimeKind.Utc).AddTicks(8254));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 12, 56, 27, 180, DateTimeKind.Utc).AddTicks(8255));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DepositAmountPaid",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DepositPaymentIntentId",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DepositPaymentLinkExpiresAt",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DepositPaymentLinkToken",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 30, 23, 40, 30, 148, DateTimeKind.Utc).AddTicks(3162));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 30, 23, 40, 30, 148, DateTimeKind.Utc).AddTicks(3168));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 3, 30, 23, 40, 30, 148, DateTimeKind.Utc).AddTicks(3170));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8472
File diff suppressed because it is too large
Load Diff
+98
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddUniqueDocumentNumberConstraints : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BalanceDue",
|
||||
table: "Bills");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "CertificateCode",
|
||||
table: "GiftCertificates",
|
||||
type: "nvarchar(450)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 13, 17, 21, 812, DateTimeKind.Utc).AddTicks(1883));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 13, 17, 21, 812, DateTimeKind.Utc).AddTicks(1891));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 13, 17, 21, 812, DateTimeKind.Utc).AddTicks(1893));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificates_CertificateCode",
|
||||
table: "GiftCertificates",
|
||||
column: "CertificateCode",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GiftCertificates_CertificateCode",
|
||||
table: "GiftCertificates");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "CertificateCode",
|
||||
table: "GiftCertificates",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(450)");
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "BalanceDue",
|
||||
table: "Bills",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 12, 56, 27, 180, DateTimeKind.Utc).AddTicks(8248));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 12, 56, 27, 180, DateTimeKind.Utc).AddTicks(8254));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 12, 56, 27, 180, DateTimeKind.Utc).AddTicks(8255));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8472
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixGiftCertificateUniqueIndexPerCompany : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GiftCertificates_CertificateCode",
|
||||
table: "GiftCertificates");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 14, 16, 49, 288, DateTimeKind.Utc).AddTicks(7180));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 14, 16, 49, 288, DateTimeKind.Utc).AddTicks(7185));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 14, 16, 49, 288, DateTimeKind.Utc).AddTicks(7186));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificates_CompanyId_CertificateCode",
|
||||
table: "GiftCertificates",
|
||||
columns: new[] { "CompanyId", "CertificateCode" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GiftCertificates_CompanyId_CertificateCode",
|
||||
table: "GiftCertificates");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 13, 17, 21, 812, DateTimeKind.Utc).AddTicks(1883));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 13, 17, 21, 812, DateTimeKind.Utc).AddTicks(1891));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 13, 17, 21, 812, DateTimeKind.Utc).AddTicks(1893));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GiftCertificates_CertificateCode",
|
||||
table: "GiftCertificates",
|
||||
column: "CertificateCode",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8478
File diff suppressed because it is too large
Load Diff
+80
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddInvoiceExternalReference : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ExternalReference",
|
||||
table: "Invoices",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9199));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9205));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9206));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_CompanyId_ExternalReference",
|
||||
table: "Invoices",
|
||||
columns: new[] { "CompanyId", "ExternalReference" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Invoices_CompanyId_ExternalReference",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ExternalReference",
|
||||
table: "Invoices");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 14, 16, 49, 288, DateTimeKind.Utc).AddTicks(7180));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 14, 16, 49, 288, DateTimeKind.Utc).AddTicks(7185));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 1, 14, 16, 49, 288, DateTimeKind.Utc).AddTicks(7186));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8481
File diff suppressed because it is too large
Load Diff
+72
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddMigratingFromQuickBooks : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MigratingFromQuickBooks",
|
||||
table: "CompanyPreferences",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 3, 21, 53, 0, DateTimeKind.Utc).AddTicks(5398));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 3, 21, 53, 0, DateTimeKind.Utc).AddTicks(5405));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 3, 21, 53, 0, DateTimeKind.Utc).AddTicks(5406));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MigratingFromQuickBooks",
|
||||
table: "CompanyPreferences");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9199));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9205));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 1, 54, 18, 864, DateTimeKind.Utc).AddTicks(9206));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8484
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddQbMigrationStateJson : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "QbMigrationStateJson",
|
||||
table: "CompanyPreferences",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 16, 57, 55, 24, DateTimeKind.Utc).AddTicks(6999));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 16, 57, 55, 24, DateTimeKind.Utc).AddTicks(7004));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 16, 57, 55, 24, DateTimeKind.Utc).AddTicks(7006));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "QbMigrationStateJson",
|
||||
table: "CompanyPreferences");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 3, 21, 53, 0, DateTimeKind.Utc).AddTicks(5398));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 3, 21, 53, 0, DateTimeKind.Utc).AddTicks(5405));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 3, 21, 53, 0, DateTimeKind.Utc).AddTicks(5406));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8485
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixInventorySkuUniqueIndex : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InventoryItems_SKU",
|
||||
table: "InventoryItems");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 47, 18, 878, DateTimeKind.Utc).AddTicks(8284));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 47, 18, 878, DateTimeKind.Utc).AddTicks(8291));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 47, 18, 878, DateTimeKind.Utc).AddTicks(8292));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InventoryItems_CompanyId_SKU",
|
||||
table: "InventoryItems",
|
||||
columns: new[] { "CompanyId", "SKU" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InventoryItems_CompanyId_SKU",
|
||||
table: "InventoryItems");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 16, 57, 55, 24, DateTimeKind.Utc).AddTicks(6999));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 16, 57, 55, 24, DateTimeKind.Utc).AddTicks(7004));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 16, 57, 55, 24, DateTimeKind.Utc).AddTicks(7006));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InventoryItems_SKU",
|
||||
table: "InventoryItems",
|
||||
column: "SKU",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8485
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixJobShopAccessCodeUniqueIndex : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Jobs_ShopAccessCode",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 52, 13, 785, DateTimeKind.Utc).AddTicks(7008));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 52, 13, 785, DateTimeKind.Utc).AddTicks(7015));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 52, 13, 785, DateTimeKind.Utc).AddTicks(7016));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Jobs_CompanyId_ShopAccessCode",
|
||||
table: "Jobs",
|
||||
columns: new[] { "CompanyId", "ShopAccessCode" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Jobs_CompanyId_ShopAccessCode",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 47, 18, 878, DateTimeKind.Utc).AddTicks(8284));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 47, 18, 878, DateTimeKind.Utc).AddTicks(8291));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 47, 18, 878, DateTimeKind.Utc).AddTicks(8292));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Jobs_ShopAccessCode",
|
||||
table: "Jobs",
|
||||
column: "ShopAccessCode",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8508
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddDashboardTips : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DashboardTips",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
TipText = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DashboardTips", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 22, 49, 46, 35, DateTimeKind.Utc).AddTicks(4841));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 22, 49, 46, 35, DateTimeKind.Utc).AddTicks(4847));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 22, 49, 46, 35, DateTimeKind.Utc).AddTicks(4849));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DashboardTips");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 52, 13, 785, DateTimeKind.Utc).AddTicks(7008));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 52, 13, 785, DateTimeKind.Utc).AddTicks(7015));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 18, 52, 13, 785, DateTimeKind.Utc).AddTicks(7016));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8548
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddStripeWebhookEvents : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "StripeWebhookEvents",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
EventId = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
EventType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: true),
|
||||
RawJson = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
ErrorMessage = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ReceivedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ProcessedAt = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_StripeWebhookEvents", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 3, 0, 6, 46, 778, DateTimeKind.Utc).AddTicks(3905));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 3, 0, 6, 46, 778, DateTimeKind.Utc).AddTicks(3912));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 3, 0, 6, 46, 778, DateTimeKind.Utc).AddTicks(3913));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "StripeWebhookEvents");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 22, 49, 46, 35, DateTimeKind.Utc).AddTicks(4841));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 22, 49, 46, 35, DateTimeKind.Utc).AddTicks(4847));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 2, 22, 49, 46, 35, DateTimeKind.Utc).AddTicks(4849));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8551
File diff suppressed because it is too large
Load Diff
+72
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddAllowAccountingToPlan : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AllowAccounting",
|
||||
table: "SubscriptionPlanConfigs",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 15, 16, 32, 254, DateTimeKind.Utc).AddTicks(1952));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 15, 16, 32, 254, DateTimeKind.Utc).AddTicks(1958));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 15, 16, 32, 254, DateTimeKind.Utc).AddTicks(1968));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowAccounting",
|
||||
table: "SubscriptionPlanConfigs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 3, 0, 6, 46, 778, DateTimeKind.Utc).AddTicks(3905));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 3, 0, 6, 46, 778, DateTimeKind.Utc).AddTicks(3912));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 3, 0, 6, 46, 778, DateTimeKind.Utc).AddTicks(3913));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8554
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddBillReceiptFilePath : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ReceiptFilePath",
|
||||
table: "Bills",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 19, 41, 22, 854, DateTimeKind.Utc).AddTicks(290));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 19, 41, 22, 854, DateTimeKind.Utc).AddTicks(296));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 19, 41, 22, 854, DateTimeKind.Utc).AddTicks(297));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ReceiptFilePath",
|
||||
table: "Bills");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 15, 16, 32, 254, DateTimeKind.Utc).AddTicks(1952));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 15, 16, 32, 254, DateTimeKind.Utc).AddTicks(1958));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 15, 16, 32, 254, DateTimeKind.Utc).AddTicks(1968));
|
||||
}
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SeedInitialDashboardTips : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// Only seed if the table is empty — preserves any tips already managed via the UI
|
||||
migrationBuilder.Sql(@"
|
||||
IF NOT EXISTS (SELECT 1 FROM [DashboardTips])
|
||||
BEGIN
|
||||
INSERT INTO [DashboardTips] ([TipText], [IsActive], [CreatedAt]) VALUES
|
||||
('Jobs can be viewed as a Kanban board. Click the ''Board View'' button on the Jobs page to drag-and-drop jobs between status columns.', 1, GETUTCDATE()),
|
||||
('Speed up job creation with Job Templates. Save a common job configuration as a template from the job details page and reuse it next time.', 1, GETUTCDATE()),
|
||||
('Customers can approve quotes online without calling you. Use the ''Send for Approval'' button on a quote — they get a link to review, approve, or reject.', 1, GETUTCDATE()),
|
||||
('Use the AI Photo Quote feature to estimate surface area and pricing from photos. Start a new quote and choose ''AI Photo Quote'' as the item type.', 1, GETUTCDATE()),
|
||||
('Track who''s working on what with Worker Assignment. Open any job and use the Assignment card to assign it to a specific shop worker.', 1, GETUTCDATE()),
|
||||
('Set a Reorder Point on inventory items and you''ll get low-stock alerts on the dashboard before you run out.', 1, GETUTCDATE()),
|
||||
('The Oven Scheduler helps you batch jobs by coating type and color to minimize changeovers. Find it under Operations in the main menu.', 1, GETUTCDATE()),
|
||||
('The Shop Access Code on each job generates a QR code your team can scan to advance the job status right from the shop floor — no login required.', 1, GETUTCDATE()),
|
||||
('Record a deposit on a quote or job before work starts. Deposits are automatically applied to the invoice when you create it.', 1, GETUTCDATE()),
|
||||
('Pricing Tiers let you set automatic discounts for your best commercial customers. Configure them under Settings → Pricing Tiers.', 1, GETUTCDATE()),
|
||||
('Flag a customer as Tax Exempt and the system will automatically zero out tax on their quotes and invoices.', 1, GETUTCDATE()),
|
||||
('The Reports section has over 20 reports including Profit & Loss, AR Aging, Powder Usage, and Job Cycle Time — all exportable to PDF.', 1, GETUTCDATE()),
|
||||
('Add photos directly from the job details page. Photos are stored with the job and are visible to customers using the Shop Access Code.', 1, GETUTCDATE()),
|
||||
('Use Job Notes to log progress, flag issues, or leave instructions for the next shift — all visible in real time on the job details page.', 1, GETUTCDATE()),
|
||||
('The Oven Scheduler tracks capacity by square footage, so you can fill each oven run to its rated maximum load.', 1, GETUTCDATE()),
|
||||
('Export your customers, jobs, quotes, and inventory to CSV anytime from the Tools page. You can also export all data at once as a ZIP.', 1, GETUTCDATE()),
|
||||
('Import your existing QuickBooks data — customers, vendors, chart of accounts, and inventory — directly from the Tools page.', 1, GETUTCDATE()),
|
||||
('Catalog Items are your pre-priced services. Add common coating types, prep services, and labor rates once and reuse them on any quote.', 1, GETUTCDATE()),
|
||||
('Multi-stage jobs? Use Prep Services on quote items to add sandblasting, masking, or custom prep costs to each individual line item.', 1, GETUTCDATE()),
|
||||
('The Setup Wizard walks you through all your operating costs — oven cost per hour, labor rates, overhead — so pricing calculations are accurate from day one.', 1, GETUTCDATE()),
|
||||
('Create an invoice directly from a completed job in one click. All line items carry over automatically with no re-entry needed.', 1, GETUTCDATE()),
|
||||
('Partial payments are supported on invoices. Record multiple payments over time and the system tracks the remaining balance automatically.', 1, GETUTCDATE()),
|
||||
('The Accounts Payable module tracks your vendor bills so you always know what''s owed and when it''s due.', 1, GETUTCDATE()),
|
||||
('Purchase Orders let you formalize vendor orders, receive inventory against them, and convert them directly to vendor bills.', 1, GETUTCDATE()),
|
||||
('Equipment records track each piece of shop equipment, its service history, and current status so nothing falls through the cracks.', 1, GETUTCDATE()),
|
||||
('Schedule preventive maintenance tasks on your equipment and the system will flag overdue items on your dashboard automatically.', 1, GETUTCDATE()),
|
||||
('Gift Certificates can be issued and redeemed from the Billing section — great for promotions, referral programs, or customer goodwill.', 1, GETUTCDATE()),
|
||||
('Use the Quotes section to build estimates for prospects (non-customers) and convert them to a full customer record once the quote is approved.', 1, GETUTCDATE()),
|
||||
('The Job Cycle Time report shows average time from job creation to delivery — a great way to spot bottlenecks in your shop workflow.', 1, GETUTCDATE()),
|
||||
('The Powder Usage report breaks down consumption by color and job so you can optimize purchasing and reduce waste.', 1, GETUTCDATE()),
|
||||
('The AR Aging report shows outstanding invoices grouped by age — 30, 60, 90+ days — so you can prioritize collections calls.', 1, GETUTCDATE()),
|
||||
('You can add multiple coats with different colors to a single quote item. The system calculates powder needed for each coat separately.', 1, GETUTCDATE()),
|
||||
('Powder Needed is calculated live in the quote wizard based on surface area, coverage rate, and efficiency — so you know exactly how much to order before you start.', 1, GETUTCDATE()),
|
||||
('The Oven Scheduler''s ''Suggest Batches'' feature automatically groups pending jobs by coating compatibility to maximize each oven run.', 1, GETUTCDATE()),
|
||||
('Shop Workers can be assigned roles like Sandblaster, Coater, or Quality Control. These roles help you track who does what on each job.', 1, GETUTCDATE()),
|
||||
('Print or text a job''s QR code to your shop workers. Scanning it opens a simple page where they can move the job to the next status step without touching the main app.', 1, GETUTCDATE()),
|
||||
('Credit limits on commercial customers help you manage risk. The system tracks each customer''s outstanding balance against their limit.', 1, GETUTCDATE()),
|
||||
('The AI Photo Quote uses Claude AI to analyze photos of the item, ask clarifying questions, and estimate surface area, complexity, and pricing — all before the item arrives.', 1, GETUTCDATE()),
|
||||
('Vendor records include payment terms, contact info, and a linked transaction history so you can see everything related to a supplier in one place.', 1, GETUTCDATE()),
|
||||
('The Setup Wizard can be re-run any time from Company Settings if you want to update your operating costs, oven configuration, or workflow defaults.', 1, GETUTCDATE()),
|
||||
('Bills and Expenses are now in one unified list under Bills / Expenses in the menu. Use the type filter to view just bills, just expenses, or both at once.', 1, GETUTCDATE()),
|
||||
('Upload a PDF or photo receipt when creating a bill. The system stores it with the bill so you always have documentation at hand.', 1, GETUTCDATE()),
|
||||
('The ''Upload and Process Receipt Image'' button on a new bill uses AI to extract the vendor, date, total, and line items — and attaches the file automatically.', 1, GETUTCDATE()),
|
||||
('When entering bill line items, the system automatically suggests the best expense account as soon as you finish typing the description — no manual lookup needed.', 1, GETUTCDATE()),
|
||||
('Mark a bill as paid right from the Create screen using the ''I Already Paid This'' toggle. Record the payment method and bank account in one step.', 1, GETUTCDATE()),
|
||||
('The Cash Flow Forecast report uses AI to project your 30, 60, and 90-day cash position based on open invoices, outstanding bills, and your active job pipeline.', 1, GETUTCDATE()),
|
||||
('Run the Anomaly Detection report regularly to catch duplicate bills, unusual vendor charges, and expense accounts running over their normal monthly spend.', 1, GETUTCDATE()),
|
||||
('Anomaly Detection flags duplicates as Critical — meaning two bills from the same vendor for the same amount within 30 days. Always worth a quick review before paying.', 1, GETUTCDATE()),
|
||||
('The AR Follow-up Email tool in the AR Aging report drafts a professional collections email for you — the tone automatically adjusts based on how many days overdue the invoice is.', 1, GETUTCDATE()),
|
||||
('The Plain-English Financial Summary in the Full Analytics view turns your P&L numbers into a short, readable paragraph — great for a quick monthly health check.', 1, GETUTCDATE())
|
||||
END
|
||||
");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("DELETE FROM [DashboardTips]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddReleaseNotes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ReleaseNotes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Version = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Body = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Tag = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
IsPublished = table.Column<bool>(type: "bit", nullable: false),
|
||||
ReleasedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedByUserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreatedByUserName = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ReleaseNotes", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(name: "ReleaseNotes");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8568
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPerformanceIndexes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2744));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2750));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2752));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InventoryTransactions_TransactionType_TransactionDate",
|
||||
table: "InventoryTransactions",
|
||||
columns: new[] { "TransactionType", "TransactionDate" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InventoryItems_CompanyId_IsActive",
|
||||
table: "InventoryItems",
|
||||
columns: new[] { "CompanyId", "IsActive" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InventoryItems_IsActive",
|
||||
table: "InventoryItems",
|
||||
column: "IsActive");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Bills_CompanyId_Status",
|
||||
table: "Bills",
|
||||
columns: new[] { "CompanyId", "Status" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Bills_DueDate",
|
||||
table: "Bills",
|
||||
column: "DueDate");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Bills_Status",
|
||||
table: "Bills",
|
||||
column: "Status");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Appointments_ScheduledStartTime",
|
||||
table: "Appointments",
|
||||
column: "ScheduledStartTime");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InventoryTransactions_TransactionType_TransactionDate",
|
||||
table: "InventoryTransactions");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InventoryItems_CompanyId_IsActive",
|
||||
table: "InventoryItems");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_InventoryItems_IsActive",
|
||||
table: "InventoryItems");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Bills_CompanyId_Status",
|
||||
table: "Bills");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Bills_DueDate",
|
||||
table: "Bills");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Bills_Status",
|
||||
table: "Bills");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Appointments_ScheduledStartTime",
|
||||
table: "Appointments");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 19, 41, 22, 854, DateTimeKind.Utc).AddTicks(290));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 19, 41, 22, 854, DateTimeKind.Utc).AddTicks(296));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 4, 19, 41, 22, 854, DateTimeKind.Utc).AddTicks(297));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8603
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPlatformSettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlatformSettings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Key = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
Value = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Label = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
GroupName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlatformSettings", x => x.Id);
|
||||
});
|
||||
|
||||
// Unique index on Key
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlatformSettings_Key",
|
||||
table: "PlatformSettings",
|
||||
column: "Key",
|
||||
unique: true);
|
||||
|
||||
// Seed default platform settings
|
||||
migrationBuilder.InsertData(
|
||||
table: "PlatformSettings",
|
||||
columns: ["Id", "Key", "Value", "Label", "Description", "GroupName"],
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "AdminNotificationEmail", null, "Admin Notification Email",
|
||||
"Email address that receives platform event notifications (new signups, bug reports, subscription events). Leave blank to disable.", "Notifications" }
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(443));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(449));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(450));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PlatformSettings_Key",
|
||||
table: "PlatformSettings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlatformSettings");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2744));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2750));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 0, 33, 47, 286, DateTimeKind.Utc).AddTicks(2752));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8604
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPlatformSettingsV2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Key",
|
||||
table: "PlatformSettings",
|
||||
type: "nvarchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
// Seed the 5 settings moved from appsettings.json
|
||||
migrationBuilder.InsertData(
|
||||
table: "PlatformSettings",
|
||||
columns: ["Id", "Key", "Value", "Label", "Description", "GroupName"],
|
||||
values: new object[,]
|
||||
{
|
||||
{ 2, "BaseUrl", null, "Base URL",
|
||||
"Public URL of this application (e.g. https://app.powdercoatinglogix.com). Used in email links. Falls back to the current request URL if blank.", "General" },
|
||||
{ 3, "TrialPeriodDays", "7", "Trial Period (days)",
|
||||
"Number of days a new company gets on the free trial before their subscription expires.", "Subscriptions" },
|
||||
{ 4, "QuoteApprovalTokenDays", "30", "Quote Approval Token Validity (days)",
|
||||
"How many days a customer quote-approval link remains valid before expiring.", "Quotes" },
|
||||
{ 5, "AuditLogRetentionDays", "365", "Audit Log Retention (days)",
|
||||
"Audit log entries older than this many days are automatically purged by the nightly job.", "Data Retention" },
|
||||
{ 6, "StripeWebhookRetentionDays", "90", "Stripe Webhook Retention (days)",
|
||||
"Processed Stripe webhook events older than this many days are automatically purged.", "Data Retention" }
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 12, 38, 590, DateTimeKind.Utc).AddTicks(904));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 12, 38, 590, DateTimeKind.Utc).AddTicks(913));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 12, 38, 590, DateTimeKind.Utc).AddTicks(914));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData("PlatformSettings", "Id", new object[] { 2, 3, 4, 5, 6 });
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Key",
|
||||
table: "PlatformSettings",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(200)",
|
||||
oldMaxLength: 200);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(443));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(449));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 15, 56, 49, 818, DateTimeKind.Utc).AddTicks(450));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8604
File diff suppressed because it is too large
Load Diff
+68
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class UpdateAdminEmailDescription : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PlatformSettings",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "Description",
|
||||
value: "Email address(es) that receive platform event notifications (new signups, bug reports, subscription events). Separate multiple addresses with commas. Leave blank to disable.");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 21, 34, 470, DateTimeKind.Utc).AddTicks(837));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 21, 34, 470, DateTimeKind.Utc).AddTicks(844));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 21, 34, 470, DateTimeKind.Utc).AddTicks(846));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 12, 38, 590, DateTimeKind.Utc).AddTicks(904));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 12, 38, 590, DateTimeKind.Utc).AddTicks(913));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 12, 38, 590, DateTimeKind.Utc).AddTicks(914));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8603
File diff suppressed because it is too large
Load Diff
+79
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MakeBillLineItemAccountIdNullable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "AccountId",
|
||||
table: "BillLineItems",
|
||||
type: "int",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 6, 19, 14, 56, 715, DateTimeKind.Utc).AddTicks(7942));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 6, 19, 14, 56, 715, DateTimeKind.Utc).AddTicks(7953));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 6, 19, 14, 56, 715, DateTimeKind.Utc).AddTicks(7955));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "AccountId",
|
||||
table: "BillLineItems",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 21, 34, 470, DateTimeKind.Utc).AddTicks(837));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 21, 34, 470, DateTimeKind.Utc).AddTicks(844));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 5, 16, 21, 34, 470, DateTimeKind.Utc).AddTicks(846));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8623
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddJobIntakeFields : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IntakeCheckedByUserId",
|
||||
table: "Jobs",
|
||||
type: "nvarchar(450)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IntakeConditionNotes",
|
||||
table: "Jobs",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "IntakeDate",
|
||||
table: "Jobs",
|
||||
type: "datetime2",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "IntakePartCount",
|
||||
table: "Jobs",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7842));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7847));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7849));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Jobs_IntakeCheckedByUserId",
|
||||
table: "Jobs",
|
||||
column: "IntakeCheckedByUserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Jobs_AspNetUsers_IntakeCheckedByUserId",
|
||||
table: "Jobs",
|
||||
column: "IntakeCheckedByUserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Jobs_AspNetUsers_IntakeCheckedByUserId",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Jobs_IntakeCheckedByUserId",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IntakeCheckedByUserId",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IntakeConditionNotes",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IntakeDate",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IntakePartCount",
|
||||
table: "Jobs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 6, 19, 14, 56, 715, DateTimeKind.Utc).AddTicks(7942));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 6, 19, 14, 56, 715, DateTimeKind.Utc).AddTicks(7953));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 6, 19, 14, 56, 715, DateTimeKind.Utc).AddTicks(7955));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8717
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddInAppNotifications : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InAppNotifications",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Message = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Link = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
NotificationType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
IsRead = table.Column<bool>(type: "bit", nullable: false),
|
||||
ReadAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
QuoteId = table.Column<int>(type: "int", nullable: true),
|
||||
InvoiceId = table.Column<int>(type: "int", nullable: true),
|
||||
CustomerId = table.Column<int>(type: "int", nullable: true),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UpdatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InAppNotifications", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_InAppNotifications_Customers_CustomerId",
|
||||
column: x => x.CustomerId,
|
||||
principalTable: "Customers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_InAppNotifications_Invoices_InvoiceId",
|
||||
column: x => x.InvoiceId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_InAppNotifications_Quotes_QuoteId",
|
||||
column: x => x.QuoteId,
|
||||
principalTable: "Quotes",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(787));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(794));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(795));
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InAppNotifications_CustomerId",
|
||||
table: "InAppNotifications",
|
||||
column: "CustomerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InAppNotifications_InvoiceId",
|
||||
table: "InAppNotifications",
|
||||
column: "InvoiceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InAppNotifications_QuoteId",
|
||||
table: "InAppNotifications",
|
||||
column: "QuoteId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "InAppNotifications");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7842));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7847));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 8, 20, 53, 42, 294, DateTimeKind.Utc).AddTicks(7849));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8757
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddLegalCompliance : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MarketingEmailOptOut",
|
||||
table: "Companies",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
// Add as nullable first so we can backfill unique GUIDs per row
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "MarketingUnsubscribeToken",
|
||||
table: "Companies",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
// Backfill: assign a unique token to every existing company row
|
||||
migrationBuilder.Sql(@"
|
||||
UPDATE Companies
|
||||
SET MarketingUnsubscribeToken = LOWER(REPLACE(NEWID(), '-', ''))
|
||||
WHERE MarketingUnsubscribeToken IS NULL
|
||||
");
|
||||
|
||||
// Now enforce non-nullable
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "MarketingUnsubscribeToken",
|
||||
table: "Companies",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TermsAcceptances",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
UserId = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CompanyId = table.Column<int>(type: "int", nullable: false),
|
||||
TosVersion = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
AcceptedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
IpAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
UserAgent = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TermsAcceptances", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 19, 30, 410, DateTimeKind.Utc).AddTicks(5127));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 19, 30, 410, DateTimeKind.Utc).AddTicks(5133));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 19, 30, 410, DateTimeKind.Utc).AddTicks(5135));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "TermsAcceptances");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MarketingEmailOptOut",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MarketingUnsubscribeToken",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(787));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(794));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 9, 1, 38, 18, 363, DateTimeKind.Utc).AddTicks(795));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8763
File diff suppressed because it is too large
Load Diff
+83
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddAiFeaturesToPlanConfig : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AllowAiInventoryAssist",
|
||||
table: "SubscriptionPlanConfigs",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AllowAiPhotoQuotes",
|
||||
table: "SubscriptionPlanConfigs",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 53, 49, 582, DateTimeKind.Utc).AddTicks(8243));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 53, 49, 582, DateTimeKind.Utc).AddTicks(8250));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 53, 49, 582, DateTimeKind.Utc).AddTicks(8252));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowAiInventoryAssist",
|
||||
table: "SubscriptionPlanConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowAiPhotoQuotes",
|
||||
table: "SubscriptionPlanConfigs");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 19, 30, 410, DateTimeKind.Utc).AddTicks(5127));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 19, 30, 410, DateTimeKind.Utc).AddTicks(5133));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 19, 30, 410, DateTimeKind.Utc).AddTicks(5135));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8763
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddTrialsEnabledSetting : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "PlatformSettings",
|
||||
columns: ["Id", "Key", "Value", "Label", "Description", "GroupName"],
|
||||
values: new object[,]
|
||||
{
|
||||
{ 7, "TrialsEnabled", "true", "Free Trials Enabled",
|
||||
"When true (default), new signups start with a free trial period. When false, a credit card is required at signup — registrants are sent through Stripe Checkout before their account is created.",
|
||||
"Subscriptions" }
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 3, 20, 23, 158, DateTimeKind.Utc).AddTicks(7184));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 3, 20, 23, 158, DateTimeKind.Utc).AddTicks(7190));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 3, 20, 23, 158, DateTimeKind.Utc).AddTicks(7191));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "PlatformSettings",
|
||||
keyColumn: "Id",
|
||||
keyValue: 7);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 53, 49, 582, DateTimeKind.Utc).AddTicks(8243));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 53, 49, 582, DateTimeKind.Utc).AddTicks(8250));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 2, 53, 49, 582, DateTimeKind.Utc).AddTicks(8252));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8763
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddMaxTenantsSetting : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "PlatformSettings",
|
||||
columns: ["Id", "Key", "Value", "Label", "Description", "GroupName"],
|
||||
values: new object[] { 8, "MaxTenants", "", "Max Tenants",
|
||||
"Maximum number of tenant companies allowed to self-register. Leave blank or 0 for unlimited. Once the limit is reached, the signup page and login signup link are hidden.",
|
||||
"Access Control" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 0, 52, 25, 307, DateTimeKind.Utc).AddTicks(1531));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 0, 52, 25, 307, DateTimeKind.Utc).AddTicks(1537));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 0, 52, 25, 307, DateTimeKind.Utc).AddTicks(1538));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData("PlatformSettings", "Id", new object[] { 8 });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 3, 20, 23, 158, DateTimeKind.Utc).AddTicks(7184));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 3, 20, 23, 158, DateTimeKind.Utc).AddTicks(7190));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 10, 3, 20, 23, 158, DateTimeKind.Utc).AddTicks(7191));
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+8769
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddCompanyFeatureOverrides : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AccountingOverride",
|
||||
table: "Companies",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "OnlinePaymentsOverride",
|
||||
table: "Companies",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 17, 41, 53, 14, DateTimeKind.Utc).AddTicks(2151));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 17, 41, 53, 14, DateTimeKind.Utc).AddTicks(2159));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 17, 41, 53, 14, DateTimeKind.Utc).AddTicks(2161));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AccountingOverride",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OnlinePaymentsOverride",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 0, 52, 25, 307, DateTimeKind.Utc).AddTicks(1531));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 0, 52, 25, 307, DateTimeKind.Utc).AddTicks(1537));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 0, 52, 25, 307, DateTimeKind.Utc).AddTicks(1538));
|
||||
}
|
||||
}
|
||||
}
|
||||
+8772
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PowderCoating.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddIsAnnualBilling : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAnnualBilling",
|
||||
table: "Companies",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 18, 34, 8, 909, DateTimeKind.Utc).AddTicks(3047));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 18, 34, 8, 909, DateTimeKind.Utc).AddTicks(3054));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 18, 34, 8, 909, DateTimeKind.Utc).AddTicks(3055));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAnnualBilling",
|
||||
table: "Companies");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 17, 41, 53, 14, DateTimeKind.Utc).AddTicks(2151));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 17, 41, 53, 14, DateTimeKind.Utc).AddTicks(2159));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "PricingTiers",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "CreatedAt",
|
||||
value: new DateTime(2026, 4, 12, 17, 41, 53, 14, DateTimeKind.Utc).AddTicks(2161));
|
||||
}
|
||||
}
|
||||
}
|
||||
src/PowderCoating.Infrastructure/Migrations/20260414135810_AddPendingRegistrationSession.Designer.cs
Generated
+8820
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user