First a bit of context, I have a fabricator for an ActiveRecord model that is backed by a materialized view which has both an id column and pk column (my custom primary key column).
I run into the issue where setting the pk or id results in both fields being set to the same string value, so my id column ends up with a string value when it should be an integer.
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
---------------------+-----------------------------+-----------+----------+---------+----------+--------------+-------------
pk | text | | | | extended | |
id | integer | | | | plain | |
Ultimately I want to be able to test I get the right data back when I perform a sql join on id column of the materialized view.
First a bit of context, I have a fabricator for an
ActiveRecordmodel that is backed by a materialized view which has both anidcolumn andpkcolumn (my custom primary key column).I run into the issue where setting the
pkoridresults in both fields being set to the same string value, so myidcolumn ends up with a string value when it should be an integer.Ultimately I want to be able to test I get the right data back when I perform a sql join on
idcolumn of the materialized view.