Skip to content

Issues when comparing EF model against postgres #42

Description

@erick-thompson

I'm using SchemaCompare on a model that is backed by postgres. It's working well, but there are a few issues.

  1. column length limit
    The limit in postgres is 63 bytes/59 characters (due to utf-8) and EF truncates the column names correctly so the object does exist, but the name doesn't match.

  2. case sensitivity on computed columns
    The model and db differ (e.g., now() vs NOW()). I'm not sure why the case differs between EF and postgres, but something changes the case.

  3. type conversion in postgres
    This problem is mainly in computed fields and defaults. For example, the expected/found for a couple of computed fields

expected: completed_at AT TIME ZONE 'America/Los_Angeles')::date
found = ((completed_at AT TIME ZONE 'America/Los_Angeles'::text))::date

or

expected = '[]'
found = '[]'::jsonb

I'm not sure the best solution for 3, but I think issues 1 and 2 could be fixed fairly easily by having two additional properties on the CompareEfSqlConfig. Something like:

bool CaseSensitivity
int MaxIdentifierLength

both of which would be used in the comparer to match on case and/or substring. Would you be open to a PR with this change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions