This will change the effects of old migrations, right? A migration that I wrote a year ago using `primary_key` that formerly created a `serial` column will now create an identity column. When I write a new migration to convert my serial primary keys to identity ones (because they do seem like an improvement) then that migration will work against my existing database but break if I run all my migrations in sequence on a newer version of Sequel? So the recommendation in this release will be to go back through all my old migrations and replace the `primary_key :id` calls with `serial :id, primary_key: true`?
I wouldn't expect a breaking change like this before 6.0.0. What if instead, primary_key takes a `:type`-esque argument whose value can be `:identity` or `:serial` to opt into the new/old behavior, and then when Sequel 6 is released the recommendation is to change old migrations to use `type: :serial`, and you can (optionally) remove the `type: :identity` from newer ones? That should maintain backwards compatibility until 6, and also make the transition pretty straightforward. On Thursday, March 8, 2018 at 7:33:40 PM UTC-5, Jeremy Evans wrote: > > Just a heads up, I've made changes to Sequel's master branch so that when > PostgreSQL 10.2+ is used, primary_key will create identity columns instead > of serial columns. Identity columns work very similarly to serial columns, > but have a number of advantages. See > https://blog.2ndquadrant.com/postgresql-10-identity-columns/ for details. > > This change could possible be backwards compatible in some minor way. I > think the benefits are worth the potential backwards compatibility issues, > so in the master branch identity columns are automatically used on 10.2+, > with no option to use serial columns. However, I'd like to get feedback > from the community regarding this change. If you feel strongly that Sequel > should provide the option to use serial columns by default, or that Sequel > should continue to use serial columns by default and make use of identity > columns opt-in, then please post here with your reasoning and the specific > problems you see with switching to identity columns. > > I'm willing to consider using serial instead of identity by default until > the release of Sequel 5.7.0. If Sequel 5.7.0 ships with identity columns > by default, that will remain the future behavior, though I'll be willing to > consider supporting serial as an option afterward. > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
