Uh oh!
There was an error while loading. Please reload this page.
Change json datatype to jsonb - #257
Conversation
senny
commented
May 18, 2015
Transitioning to Not sure wether we should keep falling back to /cc @jipiboily |
clemensg
commented
May 18, 2015
Wouldn't it be less intrusive to only change the datatype of new migrations instead of migrating every existing args column to |
senny
commented
May 18, 2015
@clemensg this change only makes sense if we think One should still be able to skip the migration if one pleases but we should make it easy to follow along. |
clemensg
commented
May 18, 2015
OK, good point. But then we should also migrate old I mean:
Or:
|
senny
commented
May 18, 2015
I don't know the details but it depends how easily we can migrate a column. I'm expecting that PostgreSQL allows us to Currently I'm thinking about a simple migration which checks for @clemensg can you investigate? |
clemensg
commented
May 18, 2015
@senny Yes. |
af42013 to
9fb7821Compareclemensg
commented
May 18, 2015
@senny I updated the PR. Btw.: In the update_to_3_2_0.sql file, I also set the args column to Regarding your concerns about the |
821db0d to
855619bComparesenny
commented
May 21, 2015
Could you add a corresponding downgrade script? Also, the Rails generator needs to be updated to generate an upgrade migration. See this PR for details https://github.com/QueueClassic/queue_classic/pull/217/files#diff-e455d018c3ab4c611d786db00a9c1458R1 |
855619b to
12c109eCompareclemensg
commented
May 21, 2015
Yes, I updated the PR. |
senny
commented
May 21, 2015
@clemensg awesome 💛 @jipiboily thoughts? |
clemensg
commented
May 27, 2015
🐌 |
senny
commented
May 31, 2015
@clemensg please be respectful with your comments. We are investing our own personal time for Open Source projects. I understand that delays can be frustrating at times but please remember that this is on our list and sometimes we can't drop everything to get it finished. Thank you for your understanding. |
clemensg
commented
May 31, 2015
Hey, I don't think a (cute) snail emoji is disrespectful.. do you really think so? Just to clarify: I meant "Any blockers? Anything left to do before this can get merged?" Of course you are investing your own personal time, so am I. |
senny
commented
May 31, 2015
@clemensg I'm saying a snail emoji could easily be interpreted as "why is this moving so slow?". Also bumping just leads to a bigger email flood. If you have big repositories like |
jipiboily
commented
Jun 8, 2015
This sounds good generally speaking. My only worry is that so far we didn't change the column type at all. We're still using text. It might be perfectly fine but it could also break things for some people, like for queue_classic_admin or other things built around it. This is quite unlikely and should be easy to fix though so I'm 👍. |
senny
commented
Jun 12, 2015
I was thinking about this some more. Maybe it's better to be conservative and don't upgrade existing databases at all. We can add a section to the README explaining how a user could perform the upgrade. This way new users get @clemensg what do you think about that approach? |
clemensg
commented
Jun 12, 2015
@senny This was my initial approach in this PR. That's why I asked Wouldn't it be less intrusive to only change the datatype of new migrations instead of migrating every existing args column to jsonb? So yes, I think so too, we should go for the more conservative approach. I'll change / revert the PR 😉 |
12c109e to
c988d96Comparesenny
commented
Jun 12, 2015
@clemensg sorry for the roundtrip 😓. Thanks for helping out and adjusting the PR. |
clemensg
commented
Jun 12, 2015
No problem. Sometimes it's worth thinking about a problem for a longer time. |
senny
commented
Jun 12, 2015
mmm, I remember a test that failed for a longer period of time but If I remember correctly I added a |
clemensg
commented
Jun 12, 2015
Looks like another test is asking for |
…son or text. Signed-off-by: Clemens Gruber <clemensgru@gmail.com>
c988d96 to
520ff8aCompareclemensg
commented
Jun 13, 2015
@senny Interesting, now it's green after I re-triggered the Travis build. |
senny
commented
Jun 13, 2015
yea, seems to be flapping. Maybe we get various speeds from Travis when running the build. Due to server load or something like that. I'll try to look at it in the near future. |
senny
commented
Jun 15, 2015
Worked fine when testing on my machine. @clemensg thanks for your patience and the roundtrip 💛! |
Hi,
as the json datatype needs to be parsed over and over again and queue_classic does not make assumptions about the ordering of args' keys, a switch to jsonb seems reasonable to me.
Quote from the PostgreSQL docs: In general, most applications should prefer to store JSON data as jsonb, unless there are quite specialized needs, such as legacy assumptions about ordering of object keys.
http://www.postgresql.org/docs/current/static/datatype-json.html
In case somebody uses 9.3 or earlier, I think it is OK to fall back to text and not check for both jsonb and json. With text we have at least no DB performance penalty, but json is reparsed with every insert. jsonb is parsed only once.