You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My experience with postgres shows that a SELECT statement cannot be trusted to order the data in a consistent way, especially with older tables. While porting some unrelated migration history over to migrate.cr, I found that I needed to change the current_version sql slightly:
def current_version
- query = "SELECT %{column} FROM %{table}" % {+ query = "SELECT %{column} FROM %{table} ORDER BY %{column} DESC" % {
column: @column,
table: @table,
}
@db.scalar(query).as(Int32 | Int64)
end
It's possible I'm misunderstanding the point of what that method does, but this tweak got it working for me.
The text was updated successfully, but these errors were encountered:
My experience with postgres shows that a
SELECT
statement cannot be trusted to order the data in a consistent way, especially with older tables. While porting some unrelated migration history over to migrate.cr, I found that I needed to change the current_version sql slightly:It's possible I'm misunderstanding the point of what that method does, but this tweak got it working for me.
The text was updated successfully, but these errors were encountered: