After upgrading a standalone app around 0.1.1-alpha.15, I started getting migration failures for a new migration. I tried dropping and re-creating the databases and same problem. Have not tried sqlite3 and assume it may work fine.
The migrations run correctly.
The following error occurs:
migration file "20200721115244_location_update_log_latest_deduplicate.js" failed
migration failed with error:
CREATE VIEW location_update_log_latest AS
SELECT t1.* FROM location_update_log t1
JOIN
(
SELECT location_id, MAX(created_at) AS MAXDATE
FROM location_update_log
GROUP BY location_id
) t2
ON t1.location_id = t2.location_id
AND t1.created_at = t2.MAXDATE
GROUP BY t1.location_id
ORDER BY created_at DESC;
- column "t1.id" must appear in the GROUP BY clause or be used in an aggregate function
?
@shmidt-i I guess this is related to the changes with the service catalog polling?
Yes, seems so. Will look into that馃憤
@shmidt-i - I have not tested this for correctness, but this will run without error on both pg & sqlite3 clients:
SELECT t1.*
FROM location_update_log t1
JOIN
(
SELECT location_id, MAX(created_at) AS MAXDATE
FROM location_update_log
GROUP BY location_id
) t2
ON t1.location_id = t2.location_id AND t1.created_at = t2.MAXDATE
GROUP BY t1.id, t1.location_id
ORDER BY created_at DESC;
Just added the GROUP BY t1.id
Yes, that part I figured, however atm I'm looking into bringing the pg workflow into our end-to-end test to avoid this kind of situations ;)
Yeah, that's a great idea!