- 25 10月, 2014 1 次提交
-
-
由 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
-
- 16 10月, 2014 3 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
In the DSL you can now do: create_table(:foos) do |t| t.bigint :hi end
-
- 03 9月, 2014 1 次提交
-
-
由 Ryuta Kamizono 提交于
TableDefinition#column is not called from `add_column`. Use TableDefinition#new_column_definition for column option handling.
-
- 02 9月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
Method .strip_heredoc is defined in active_support/core_ext/string/strip.rb so we need to require it. [fixes #16677]
-
- 29 8月, 2014 1 次提交
-
-
由 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.
-
- 20 8月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
`strip_heredoc` method is defined on active_support/core_ext/string
-
- 13 8月, 2014 1 次提交
-
-
由 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.
-
- 22 7月, 2014 1 次提交
-
-
由 Andrey Novikov 提交于
[Andrey Novikov & Łukasz Sarnacki]
-
- 29 6月, 2014 1 次提交
-
-
由 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.
-
- 27 6月, 2014 7 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Yves Senn 提交于
The name of the foreign key is not relevant from a users perspective. Using random names resolves the urge to rename the foreign key when the respective table or column is renamed.
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
- 04 6月, 2014 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
-
- 20 5月, 2014 1 次提交
-
-
由 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`.
-
- 18 5月, 2014 2 次提交
-
-
由 Marc Schütz 提交于
-
由 Sean Griffin 提交于
-
- 31 3月, 2014 1 次提交
-
-
由 Luke Steensen 提交于
fixes #10613
-
- 14 12月, 2013 1 次提交
-
-
由 Cody Cutrer 提交于
also override drop_table in AbstractMySQLAdapter to properly drop temporary tables without committing the transaction
-
- 09 8月, 2013 1 次提交
-
-
由 Vipul A M 提交于
-
- 13 6月, 2013 1 次提交
-
-
由 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.
-
- 04 6月, 2013 1 次提交
-
-
由 Adam Anderson 提交于
When then PostgreSQL visitor was [added](https://github.com/rails/rails/commit/6b7fdf3bf3675a14eae74acc5241089308153a34) `add_column` was no longer receiving the column options directly. This caused the options to be lost along the way.
-
- 12 5月, 2013 1 次提交
-
-
由 Rafael Mendonça França 提交于
Don't modify args in TableDefinition#primary_key
-
- 02 4月, 2013 1 次提交
-
-
由 Victor Costan 提交于
-
- 28 3月, 2013 1 次提交
-
-
由 Ken Mazaika 提交于
-
- 24 3月, 2013 1 次提交
-
-
由 doabit 提交于
-
- 23 3月, 2013 9 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-