-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct sqlite-to-postgres column mapping #1828
Conversation
That's interesting. The backend column was indeed added later, but after this migration, backend should be before metric. So it probably depends on which version of the SQLite table you have when doing the export. |
Interesting! What would you expect in this situation? Perhaps adding some columns mapping strategy? |
Oh wait! In SQLite, the backend column is placed before the metric column. However, in PostgreSQL, it remains after the metric column. |
Oh, good find, I made this error when writing the last migration. It's a PITA to keep these two DB backends in sync. |
Yep, and it seems somewhat inevitable. I think it would be reasonable to introduce some column mapping to avoid these kinds of issues in the future. |
Yeah, the conversion script should probably be able to support different column order in both backends. |
Or, we could try passing columns to function select name from PRAGMA_TABLE_INFO('table_name') order by cid |
This is a bit outside of my current SQL-fu, but if it works, let's go for it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable. I assume that the conversion now works for you, after the latest commit?
Yes, works as expected. P.S. I just made some minor wording changes and added information about the panics. |
The
backend
column was added later to thepstat_series
table.This PR reorders the column order to comply with the schema.
Closes #1827