Skip to content

bug(persistence): AppDbContext.OnModelCreating missing UseSqliteFriendlyConversions() #44

@jaybarden1

Description

@jaybarden1

Problem

Persistence/AppDbContext.csOnModelCreating calls only ApplyConfigurationsFromAssembly. Per onedrive-persistence.md: "Always call UseSqliteFriendlyConversions() before ApplyConfigurationsFromAssembly." This extension registers global converters for DateTimeOffset and Guid that SQLite cannot store natively. Without it, any new field added without an explicit per-property converter will silently corrupt data.

Required fix

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.UseSqliteFriendlyConversions();
    modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
}

Rule reference

@.claude/rules/onedrive-persistence.md — AppDbContext section

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions