1. 25 10月, 2014 1 次提交
    • D
      Use type column first in multi-column indexes · 9cdd0a1f
      Derek Prior 提交于
      `add_reference` can very helpfully add a multi-column index when you use
      it to add a polymorphic reference. However, the first column in the
      index is the `id` column, which is less than ideal.
      
      The [PostgreSQL docs][1] say:
      > A multicolumn B-tree index can be used with query conditions that
      > involve any subset of the index's columns, but the index is most
      > efficient when there are constraints on the leading (leftmost)
      > columns.
      
      The [MySQL docs][2] say:
      > MySQL can use multiple-column indexes for queries that test all the
      > columns in the index, or queries that test just the first column, the
      > first two columns, the first three columns, and so on. If you specify
      > the columns in the right order in the index definition, a single
      > composite index can speed up several kinds of queries on the same
      > table.
      
      In a polymorphic relationship, the type column is much more likely to be
      useful as the first column in an index than the id column. That is, I'm
      more likely to query on type without an id than I am to query on id
      without a type.
      
      [1]: http://www.postgresql.org/docs/9.3/static/indexes-multicolumn.html
      [2]: http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html
      9cdd0a1f
  2. 16 10月, 2014 3 次提交
  3. 03 9月, 2014 1 次提交
  4. 02 9月, 2014 1 次提交
  5. 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
  6. 20 8月, 2014 1 次提交
  7. 13 8月, 2014 1 次提交
    • S
      Change the default `null` value for timestamps · ea3ba345
      Sean Griffin 提交于
      As per discussion, this changes the model generators to specify
      `null: false` for timestamp columns. A warning is now emitted if
      `timestamps` is called without a `null` option specified, so we can
      safely change the behavior when no option is specified in Rails 5.
      ea3ba345
  8. 22 7月, 2014 1 次提交
  9. 29 6月, 2014 1 次提交
    • S
      Always pass a column with a type object to quote · b404613c
      Sean Griffin 提交于
      The only case where we got a column that was not `nil`, but did not
      respond to `cast_type` was when type casting the default value during
      schema creation. We can look up the cast type, and add that object to
      the column definition. Will allow us to consistently rely on the type
      objects for type casting in all directions.
      b404613c
  10. 27 6月, 2014 7 次提交
  11. 04 6月, 2014 1 次提交
  12. 20 5月, 2014 1 次提交
    • S
      Remove :timestamp column type · d0f8c46e
      Sean Griffin 提交于
      The `:timestamp` type for columns is unused. All database adapters treat
      them as the same database type. All code in `ActiveRecord` which changes
      its behavior based on the column's type acts the same in both cases.
      However, when the type is passed to code that checks for the `:datetime`
      type, but not `:timestamp` (such as XML serialization), the result is
      unexpected behavior.
      
      Existing schema definitions will continue to work, and the `timestamp`
      type is transparently aliased to `datetime`.
      d0f8c46e
  13. 18 5月, 2014 2 次提交
  14. 31 3月, 2014 1 次提交
  15. 14 12月, 2013 1 次提交
  16. 09 8月, 2013 1 次提交
  17. 13 6月, 2013 1 次提交
    • J
      Moving add_column_options! up to SchemaCreation · ea72430b
      jeran 提交于
      removed two instances of add_column_options! from abstract_mysql_adapter
      
      reworked rename_column_sql to remove add_column_options from schema_statements
      
      changed to use new hash syntax.
      ea72430b
  18. 04 6月, 2013 1 次提交
  19. 12 5月, 2013 1 次提交
  20. 02 4月, 2013 1 次提交
  21. 28 3月, 2013 1 次提交
  22. 24 3月, 2013 1 次提交
  23. 23 3月, 2013 9 次提交