1. 06 5月, 2016 2 次提交
  2. 18 4月, 2016 1 次提交
  3. 25 3月, 2016 1 次提交
    • C
      Make 'migrate' clear the schema cache afterward · 16dadb12
      Chris Arcand 提交于
      Without clearing the caches afterward, removals done in migrations would
      not be reflected in a separate task in the same process. That is, given
      a table with a migration to remove a column, the schema cache would
      still reflect that a table has that in something such as the
      'db:seed' task:
      
      `rake db:migrate db:seed`
      (A common thing to do in a script for a project ala `bin/setup`)
      
      vs
      
      `rake db:migrate && rake db:seed`
      (Two processes)
      
      The first would not reflect that the column was removed.
      The second would (cache reset).
      16dadb12
  4. 15 3月, 2016 1 次提交
    • R
      Creates development and test databases in db:migrate task · 6ca9031b
      Rafael Mendonça França 提交于
      This reverts a334425c.
      
      The main reason is that now the workflow is inconsistent when using
      spring.
      
      When using spring `RAILS_ENV` is always set, so only one database is
      created.
      
      This means that in development `bin/rake db:create` and `bundle exec
      rake db:create` have different results.
      
      It also breaks the `bin/setup` script since `bin/rake db:setup
      db:test:prepare` will fail.
      6ca9031b
  5. 24 2月, 2016 1 次提交
  6. 09 1月, 2016 2 次提交
  7. 08 1月, 2016 3 次提交
    • S
    • S
      Add EnvironmentMismatchError · a76c4233
      schneems 提交于
      Raise an error when a destructive action is made on a database where the current environment is different from the environment stored in the database.
      a76c4233
    • S
      Prevent destructive action on production database · 900bfd94
      schneems 提交于
      This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd.
      
      It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large.
      
      To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
      900bfd94
  8. 18 12月, 2015 1 次提交
  9. 21 10月, 2015 2 次提交
    • J
      Exit with non-zero status when db:drop fails · c2e597a7
      Jay Hayes 提交于
      * If the drop task fails for a reason other than the database not
        existing, processing should end. This is indicated by a non-zero
        exit status.
      * Since the backtrace is already printed to screen, we forgo
        printing it again by using an explicit call to `exit`.
      *  This modifies the behavior of the db:create task slightly in
        that the stack trace is no longer printed by default. If the `--trace`
        option is used, it will print the trace _after_ the error message.
      c2e597a7
    • J
      Exit with non-zero status when db:create fails · 2893e6c0
      Jay Hayes 提交于
      * If the create task fails for a reason other than the database already
        existing, processing should end. This is indicated by a non-zero exit
        status.
      * Since the backtrace is already printed to screen, we forgo printing it
        again by using an explicit call to `exit`.
      *  This modifies the behavior of the db:create task slightly in
        that the stack trace is no longer printed by default. If the `--trace`
        option is used, it will print the trace _after_ the error message.
      2893e6c0
  10. 14 10月, 2015 2 次提交
    • Y
      applies new doc guidelines to Active Record. · 428d47ad
      Yves Senn 提交于
      The focus of this change is to make the API more accessible.
      References to method and classes should be linked to make it easy to
      navigate around.
      
      This patch makes exzessiv use of `rdoc-ref:` to provide more readable
      docs. This makes it possible to document `ActiveRecord::Base#save` even
      though the method is within a separate module
      `ActiveRecord::Persistence`. The goal here is to bring the API closer to
      the actual code that you would write.
      
      This commit only deals with Active Record. The other gems will be
      updated accordingly but in different commits. The pass through Active
      Record is not completely finished yet. A follow up commit will change
      the spots I haven't yet had the time to update.
      
      /cc @fxn
      428d47ad
    • Y
      fix RDoc list markup in `DatabaseTasks`. [ci skip] · 31af8c90
      Yves Senn 提交于
      31af8c90
  11. 09 9月, 2015 1 次提交
  12. 07 9月, 2015 1 次提交
  13. 02 8月, 2015 1 次提交
    • S
      Add run_cmd class method to ActiveRecord::Tasks::DatabaseTasks · 07f8a96a
      starbelly 提交于
        -   Added run_cmd() class method to dry up Kernel.system() messages within
            this namespace and avoid shell expansion by passing a list of
            arguments instead of a string
      
        -   Update structure_dump, structure_load, and related tests units to
            pass a list of params instead of using a string to
            avoid shell expansion
      07f8a96a
  14. 04 3月, 2015 1 次提交
  15. 24 12月, 2014 1 次提交
  16. 23 12月, 2014 1 次提交
  17. 18 12月, 2014 1 次提交
    • Y
      `db:structure:load` and `db:schema:load` no longer purge the database. · 36ce0c2c
      Yves Senn 提交于
      Closes #17945
      
      `db:test:prepare` still purges the database to always keep the test
      database in a consistent state.
      
      This patch introduces new problems with `db:schema:load`. Prior
      to the introduction of foreign-keys, we could run this file against
      a non-empty database. Since every `create_table` containted the
      `force: true` option, this would recreate tables when loading the schema.
      
      However with foreign-keys in place, `force: true` wont work anymore and
      the task will crash.
      
      /cc @schneems
      36ce0c2c
  18. 01 11月, 2014 1 次提交
  19. 29 10月, 2014 1 次提交
    • X
      let's warn with heredocs · b3bfa361
      Xavier Noria 提交于
      The current style for warning messages without newlines uses
      concatenation of string literals with manual trailing spaces
      where needed.
      
      Heredocs have better readability, and with `squish` we can still
      produce a single line.
      
      This is a similar use case to the one that motivated defining
      `strip_heredoc`, heredocs are super clean.
      b3bfa361
  20. 04 9月, 2014 1 次提交
  21. 30 8月, 2014 2 次提交
  22. 29 8月, 2014 1 次提交
    • G
      Avoid using heredoc for user warnings · 8c52480b
      Godfrey Chan 提交于
      Using heredoc would enforce line wrapping to whatever column width we decided to
      use in the code, making it difficult for the users to read on some consoles.
      
      This does make the source code read slightly worse and a bit more error-prone,
      but this seems like a fair price to pay since the primary purpose for these
      messages are for the users to read and the code will not stick around for too
      long.
      8c52480b
  23. 06 8月, 2014 2 次提交
  24. 01 8月, 2014 1 次提交
  25. 28 7月, 2014 1 次提交
  26. 02 7月, 2014 1 次提交
  27. 27 6月, 2014 1 次提交
  28. 17 6月, 2014 1 次提交
  29. 14 6月, 2014 1 次提交
  30. 12 6月, 2014 1 次提交
  31. 15 4月, 2014 1 次提交
  32. 08 1月, 2014 1 次提交