| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
This allows us so abstract the migration from the type that is actually
used by Rails. For example, ":string" may be a varchar or something,
but the framework does that translation, and the app shouldn't need to
know.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Some comments that are meant to separate blocks of code in a file show up
on http://api.rubyonrails.org as though they were part of the documentation.
This commit hides those comments from the documentation.
Stems from the discussion with @zzak at https://github.com/voloko/sdoc/issues/79#issuecomment-64158738
[ci skip]
|
|
|
|
|
|
|
|
| |
Also checked to make sure this does not affect foreign key constraints.
(It doesn't).
Fixes #12856
Closes #14088
|
|
|
|
| |
We can't change the signature without a deprecation cycle.
|
|\
| |
| | |
Wrap code snippets in +, not backticks, in sdoc [ci skip]
|
| |
| |
| |
| |
| |
| |
| |
| | |
I grepped the source code for code snippets wrapped in backticks in the comments
and replaced the backticks with plus signs so they are correctly displayed in
the Rails documentation.
[ci skip]
|
|/ |
|
|
|
|
|
|
|
|
| |
This makes the following changes:
* warn if `:null` is not passed to `add_timestamps`
* `timestamps` method docs link to `add_timestamps` docs
* explain where additional options go
* adjust examples to include `null: false` (to prevent deprecation warnings)
|
|
|
|
| |
This reverts commit da99a2a2982d35f670ad9647463e09bfe9032b70.
|
| |
|
|
|
|
| |
Oh hey, we got to remove some code because of that!
|
|
|
|
|
|
| |
Arel handles this for us automatically. Updated tests, as BindParam is
no longer a subclass of SqlLiteral. We should remove the second argument
to substitute_at entirely, as it's no longer used
|
|
|
|
|
|
| |
This caused a pretty major performance regression for 4.2, as this is a
hotspot for query construction. We're still slightly slower than 4.1,
but it's much less significant.
|
| |
|
|
|
|
|
| |
also increase the version of pg required so that people will get the
GVL friendly version
|
|\
| |
| |
| | |
add a Table#name accessor like TableDefinition#name
|
| | |
|
|\ \
| |/
|/| |
remove never called method `limited_update_conditions`
|
| | |
|
|/
|
|
|
| |
- remove unused method `supports_add_column?`
- change additional restriction method to `valid_alter_table_type?`
- fix code style
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why are people assigning booleans to string columns? >_>
We unintentionally changed the behavior on Sqlite3 and PostgreSQL.
Boolean values should cast to the database's representation of true and
false. This is 't' and 'f' by default, and "1" and "0" on Mysql. The
implementation to make the connection adapter specific behavior is hacky
at best, and should be re-visted once we decide how we actually want to
separate the concerns related to things that should change based on the
database adapter.
That said, this isn't something I'd expect to change based on my
database adapter. We're storing a string, so the way the database
represents a boolean should be irrelevant. It also seems strange for us
to give booleans special behavior at all in string columns. Why is
`to_s` not sufficient? It's inconsistent and confusing. Perhaps we
should consider deprecating in the future.
Fixes #17571
|
| |
|
|\
| |
| | |
Remove unused duplicated method `add_column_position` from AbstractMysqlAdapter.
|
| |
| |
| |
| | |
AbstractMysqlAdapter
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
MySQL reports the column name as `"MAX(developer_id)"`. PG will report
it as `"max"`
|
|\ \
| |/
|/| |
Remove redundant substitute index when constructing bind values
|
| |
| |
| |
| |
| |
| | |
We end up re-ordering them either way when we construct the Arel AST (in order
to deal with rewhere, etc), so we shouldn't bother giving it a number in the
first place beforehand.
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
Skip setting sequence on a table create if the value is 0 since it will start the first value at 1 anyway.
This fixes the PG error 'setval: value 0 is out of bounds for sequence vms_id_seq...' encountered when migrating a new DB.
BugzID: 15452,9772,13475,16850
|
| |
|
|\
| |
| | |
Remove redundant `to_s` in interpolation
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
mcfiredrill/doc-change-column-default-abstract-mysql-adapter
document change_column and change_column_default for abstract_mysql_adapter [ci skip]
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The MySQLAdapter type map used the lowest priority for enum types.
This was the result of a recent refactoring and lead to some broken lookups
for enums with values that match other types. Like `8bit`.
This patch restores the priority to what we had before the refactoring.
/cc @sgrif
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch uniformizes warning messages. I used the most common style
already present in the code base:
* Capitalize the first word.
* End the message with a full stop.
* "Rails 5" instead of "Rails 5.0".
* Backticks for method names and inline code.
Also, converted a few long strings into the new heredoc convention.
|
| | |
|
|\ \
| | |
| | | |
let warn with heredocs
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
The query cache uses bind values as hash keys. The current
implementation relies on reference equality for hash equality. This is
brittle, and can easily break in the future.
|
|/
|
|
| |
We shouldn't rely on reference equality of these objects in tests
|
|\
| |
| |
| |
| |
| |
| | |
Use type column first in multi-column indexes
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`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
|
| |
| |
| |
| | |
This will avoid naming clash with user defined methods
|