rails/railties/CHANGELOG.md
David Heinemeier Hansson 2f92b1c94e
Add not-null modifier to migrations (#52327)
* Add migration type modifier for not-null attributes

* Explain change

* Appease rubocop by using AS helper

* Deal with nil
2024-07-16 14:37:42 +02:00

1.7 KiB

  • Add not-null type modifier to migration attributes.

    Generating with...

    bin/rails generate migration CreateUsers email_address:string!:uniq password_digest:string!

    Produces:

    class CreateUsers < ActiveRecord::Migration[8.0] def change create_table :users do |t| t.string :email_address, null: false t.string :password_digest, null: false

      t.timestamps
    end
    add_index :users, :email_address, unique: true
    

    end end

    DHH

  • Add script folder and generator

    Add a new script default folder to hold your one-off or general purpose scripts, such as data migration scripts, cleanup scripts, etc.

    A new script generator allows you to create such scripts:

    rails generate script my_script

    You can run the generated script using:

    ruby script/my_script.rb

    Jerome Dalbert, Haroon Ahmed

  • Enable tracking route source locations only when using routes command. Previously, it was enabled in development mode, but is only needed for bin/rails routes -E.

    Gannon McGibbon

  • Deprecate bin/rake stats in favor of bin/rails stats.

    Juan Vásquez

  • Add internal page /rails/info/notes, that displays the same information as bin/rails notes.

    Deepak Mahakale

  • Add Rubocop and GitHub Actions to plugin generator. This can be skipped using --skip-rubocop and --skip-ci.

    Chris Oliver

  • Use Kamal for deployment by default, which includes generating a Rails-specific config/deploy.yml. This can be skipped using --skip-kamal. See more: https://kamal-deploy.org/

    DHH

Please check 7-2-stable for previous changes.