Adding a Primary Key To An Existing Table [via RoR] - eviltoast
  • towerful@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    I feel like a lot of the complication of this story was from using rails to try and develop the implementation of adding a primary key to the database.
    Initially testing via SQL would’ve quickly blown through the null and default requirements, after which it’s just translating into whatever ORM you are using, testing and deploying.

    I know a lot of ORMs make it super easy to quicky add a migration in a language you already know well. But primary keys are pretty core to tables, and probably something assumed to be set up when first creating the table (ie rails did auto-magick with the new id column).