Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Specifying timestamps in a migration does not honor options

#828

Currently, this will fail in a migration


    create_table :accounts do |accounts_table|
      accounts_table.with_options :null => false do |t|
        t.string :name
        t.timestamps
      end
    end

The t.timestamps method should be updated to take even just a subset of options (like :null => false as above). This patch (attached) will allow you to specify additional options using .with_options as above, or even directly:


    create_table :passwords do |t|
      t.timestamps :null => false
    end

Reported by Patrick Reagan · August 14th, 2008 @ 02:46 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Matt Swasey
  2. Pratik
    Pratik
    • State changed from new to incomplete

    Patch doesn't apply cleanly. Could you please upload a new patch against latest edge ? Also, no need to use with_options in the tests. And tests should test if the column was successfully created with specified options.

    Thanks.

    August 22nd, 2008 @ 01:59 AM

  3. Patrick Reagan
  4. Patrick Reagan
    Patrick Reagan

    This updated patch should address your comments - I was able to apply the new one against the latest Edge (got a couple whitespace warnings). I also squashed the changeset down to a single commit to cut down on the noise.

    August 22nd, 2008 @ 04:16 AM

  5. Repository
    Repository
    • State changed from incomplete to resolved

    (from [683ff235e6b81d28962f5a71ff53730a1c118fc8]) Ensure t.timestamps respects options. [#828 Specifying timestamps in a migration does not honor options state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    August 22nd, 2008 @ 12:49 PM

  6. Repository
    Repository

    (from [9c11b96c721e0aef3186e67ed1c9fdd172488668]) Ensure t.timestamps respects options. [#828 Specifying timestamps in a migration does not honor options state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    August 25th, 2008 @ 09:31 AM