Postgres-specific type handling and test adjustments needed with some upstream dependencies.
The issue involves fixing Postgres-specific type comparisons and test behaviors, with some upstream fixes required. It requires understanding of database type handling and test decorators. Blockers include CI inconsistencies and upstream dependencies.
TODO (Related to #21613) This issue is meant to track progress of Postgres Support (as part of a multi-db feat.)
test_unique_index_on_alter to run on Postgres (works locally, fails CI?...fix needed here! -> UPDATE: It's an implementation problem causing unnecessary performance drag, PR fixes that by adding a single unique index)The identified Aliases are:
decimal(21,9) -(stored as)-> numeric(21,9)
int -(stored as)-> integer
varchar -(stored as)-> character varying
Doc Link : Postgres Data Types
This results in redundant ALTER TABLE operations:
if current_def["type"] != column_type and not (
# XXX: MariaDB JSON is same as longtext and information schema still returns longtext
current_def["type"] == "longtext" and column_type == "json" and frappe.db.db_type == "mariadb"):
self.table.change_type.append(self)
This causes false-positive migrations and failing sanity tests like: TestDBUpdateSanityChecks.test_no_unnecessary_migrates.
Possible Solution: Write a def normalize_type_for_diff util that handles this comparison for Postgres too.
unimplemented macro (Rust) that handles skipping test for postgres but specifically in cases where it makes no sense to run (i.e. MariaDB behavior specific test) or because of lack of proper implementation with respect to postgres behavior.Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!