I'm using SchemaCompare on a model that is backed by postgres. It's working well, but there are a few issues.
-
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.
-
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.
-
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?
I'm using SchemaCompare on a model that is backed by postgres. It's working well, but there are a few issues.
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.
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.
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?