aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
Commit message (Collapse)AuthorAgeFilesLines
* allow the "USING" statement to be specified on change column callsAaron Patterson2014-11-241-1/+3
|
* Mark comments that should not be in the docsclaudiob2014-11-244-0/+14
| | | | | | | | | | | 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]
* Rename the primary key index when renaming a table in pgSean Griffin2014-11-221-0/+3
| | | | | | | | Also checked to make sure this does not affect foreign key constraints. (It doesn't). Fixes #12856 Closes #14088
* ConnectionAdapter#substitute_at is technically public API...Sean Griffin2014-11-211-1/+1
| | | | We can't change the signature without a deprecation cycle.
* Merge pull request #17695 from claudiob/replace-all-backticks-with-plusesYves Senn2014-11-213-4/+4
|\ | | | | Wrap code snippets in +, not backticks, in sdoc [ci skip]
| * Wrap code snippets in +, not backticks, in sdocclaudiob2014-11-203-4/+4
| | | | | | | | | | | | | | | | 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]
* | raise a better exception for renaming long indexesAaron Patterson2014-11-202-0/+6
|/
* synchronize code and docs for `timestamps` and `add_timestamps`.Yves Senn2014-11-203-8/+11
| | | | | | | | 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)
* Revert "PERF: optimise type lookup to avoid invoking procs"Sean Griffin2014-11-191-13/+7
| | | | This reverts commit da99a2a2982d35f670ad9647463e09bfe9032b70.
* Support symbol foreign key to deletedtaniwaki2014-11-191-1/+1
|
* Remove the unused second argument to `substitute_at`Sean Griffin2014-11-171-2/+2
| | | | Oh hey, we got to remove some code because of that!
* rm `reorder_bind_params`Sean Griffin2014-11-172-5/+1
| | | | | | 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
* Improve the performance of quoting table names on PGSean Griffin2014-11-171-4/+15
| | | | | | 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.
* PERF: optimise type lookup to avoid invoking procsSam2014-11-171-7/+13
|
* exec_prepared is GVL friendly, so lets use it.Aaron Patterson2014-11-131-4/+2
| | | | | also increase the version of pg required so that people will get the GVL friendly version
* Merge pull request #17580 from ccutrer/change_table_nameYves Senn2014-11-111-17/+19
|\ | | | | | | add a Table#name accessor like TableDefinition#name
| * add a Table#name accessor like TableDefinition#nameCody Cutrer2014-11-101-17/+19
| |
* | Merge pull request #17585 from aderyabin/remove_limited_update_conditionsRafael Mendonça França2014-11-102-8/+0
|\ \ | |/ |/| remove never called method `limited_update_conditions`
| * remove never called method `limited_update_conditions`Andrey Deryabin2014-11-112-8/+0
| |
* | tiny code improvement in sqlite3 adapter:Andrey Deryabin2014-11-101-6/+2
|/ | | | | - remove unused method `supports_add_column?` - change additional restriction method to `valid_alter_table_type?` - fix code style
* Revert the behavior of booleans in string columns to that of 4.1Sean Griffin2014-11-091-1/+23
| | | | | | | | | | | | | | | | | | | | | 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
* docs, the abstract data type `:timestamp` was removed. See #15184 [ci skip]Yves Senn2014-11-071-2/+2
|
* Merge pull request #17473 from vipulnsward/rm-unused-methodYves Senn2014-11-051-8/+0
|\ | | | | Remove unused duplicated method `add_column_position` from AbstractMysqlAdapter.
| * - Remove unused duplicated method `add_column_position` from ↵Vipul A M2014-11-011-8/+0
| | | | | | | | AbstractMysqlAdapter
* | Added SchemaDumper support for tables with jsonb columns.Ted O'Meara2014-11-041-0/+1
| |
* | Remove unneeded autoloadRafael Mendonça França2014-11-031-4/+1
| |
* | Avoid unnecessary allocations/callsPablo Herrero2014-11-022-2/+2
| |
* | Correctly cast calculation results on PGSean Griffin2014-11-012-0/+14
| | | | | | | | | | MySQL reports the column name as `"MAX(developer_id)"`. PG will report it as `"max"`
* | Merge pull request #17463 from mrgilman/remove-index-from-substitute-atSean Griffin2014-11-012-2/+2
|\ \ | |/ |/| Remove redundant substitute index when constructing bind values
| * Remove redundant substitute index when constructing bind valuesMelanie Gilman2014-10-312-2/+2
| | | | | | | | | | | | 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.
* | remove unused and untested APIAaron Patterson2014-10-311-6/+2
| |
* | fix set_pk_sequence and add a test for it.Aaron Patterson2014-10-311-1/+1
| |
* | Added region sequencing of primary keys for Postgres.Joe Rafaniello2014-10-311-0/+21
|/ | | | | | | 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 interpolationclaudiob2014-10-305-8/+8
|
* Merge pull request #17434 from claudiob/remove-redundant-to-sXavier Noria2014-10-301-2/+2
|\ | | | | Remove redundant `to_s` in interpolation
| * Remove redundant `to_s` in interpolationclaudiob2014-10-291-2/+2
| |
* | add bigserial pk supportAaron Patterson2014-10-291-0/+1
|/
* Merge pull request #17411 from ↵Rafael Mendonça França2014-10-291-1/+1
|\ | | | | | | | | mcfiredrill/doc-change-column-default-abstract-mysql-adapter document change_column and change_column_default for abstract_mysql_adapter [ci skip]
| * :nodoc: for abstract_mysql_adapterTony Miller2014-10-291-1/+1
| |
* | fix MySQL enum type lookup with values matching another type. Closes #17402.Yves Senn2014-10-291-6/+6
| | | | | | | | | | | | | | | | | | | | 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
* | edit pass over all warningsXavier Noria2014-10-283-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Add mysql and pg specific attributes to Column#== and hashSean Griffin2014-10-282-2/+20
| |
* | Merge pull request #17421 from rails/warn-with-heredocXavier Noria2014-10-284-15/+26
|\ \ | | | | | | let warn with heredocs
| * | let's warn with heredocsXavier Noria2014-10-284-15/+26
| |/ | | | | | | | | | | | | | | | | | | | | | | 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.
* | Implement hash equality on columnSean Griffin2014-10-281-0/+5
| | | | | | | | | | | | 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.
* | Implement #== for columnSean Griffin2014-10-281-0/+8
|/ | | | We shouldn't rely on reference equality of these objects in tests
* Merge pull request #14143 from derekprior/dp-compound-index-orderingYves Senn2014-10-272-2/+2
|\ | | | | | | | | | | | | Use type column first in multi-column indexes Conflicts: activerecord/CHANGELOG.md
| * Use type column first in multi-column indexesDerek Prior2014-10-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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
* | Prefix internal method with _Rafael Mendonça França2014-10-251-2/+2
| | | | | | | | This will avoid naming clash with user defined methods
* | Fix description of OID in TypeMapInitializerPrathamesh Sonpatki2014-10-251-1/+1
|/ | | | [ci skip]