Coder Social home page Coder Social logo

Comments (9)

zachdaniel avatar zachdaniel commented on June 22, 2024 1

Its an interesting idea, we could potentially do something like this by default. I think its reasonable that some migrations will have to have manual intervention, but this seems like something we could potentially detect and provide a better default for.

from ash_postgres.

zachdaniel avatar zachdaniel commented on June 22, 2024 1

Yeah, but a string is a valid jsonb. So my point is even with USING column:jsonb it will still not be an actual object under the hood.

from ash_postgres.

zachdaniel avatar zachdaniel commented on June 22, 2024 1

Yeah, exactly. Its possible that in the future we could do it with something interactive in cases we can detect an issue, but the juice is unlikely to be worth the squeeze.

from ash_postgres.

zachdaniel avatar zachdaniel commented on June 22, 2024

In this case, though, it would produce a jsonb string and not a map though.

from ash_postgres.

dmitriid avatar dmitriid commented on June 22, 2024

The migrations generator produced modify :settings, :jsonb for me when I changed attribute type from string to mapπŸ€”

from ash_postgres.

dmitriid avatar dmitriid commented on June 22, 2024

Ah! I see what you mean.

I missed this because in my case I was storing Jason.encoded strings anyway :) But if there were other strings, it would either fail, or would fail on read πŸ€”

No idea how to solve this properly besides generating warnings or comments during migration or when generating migrations.

from ash_postgres.

zachdaniel avatar zachdaniel commented on June 22, 2024

Yeah, I mean honestly thats what happens when you run the migrations, the data store tells you that you can't actually do that transition and have to figure out some other way to do what you want. I'm not sure if the migration generator should try to figure this one out since it can't know what the right answer is.

from ash_postgres.

zachdaniel avatar zachdaniel commented on June 22, 2024

I think we can't reliably do this kind of thing currently. Folks will need to edit the migrations themselves.

from ash_postgres.

dmitriid avatar dmitriid commented on June 22, 2024

awww shucks :(

Well, it will probably affect a very small number of migrations anyway, and the solution is quite easy.

from ash_postgres.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.