| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This used to raise a `IrreversibleMigration` error (since #10437).
However since `remove_index :table, :column` is probably the most basic
use-case we should make it reversible again.
Conflicts:
activerecord/CHANGELOG.md
|
|\
| |
| |
| |
| |
| |
| | |
Make remove_foreign_key reversible
Conflicts:
activerecord/CHANGELOG.md
|
|/ |
|
|
|
|
|
|
|
|
|
| |
If the subtype provides custom schema dumping behavior, we need to defer
to it. We purposely choose not to handle any values other than an array
(which technically should only ever be `nil`, but I'd rather code
defensively here).
Fixes #20515.
|
|\
| |
| | |
Return a `Point` object from the PG Point type
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This introduces a deprecation cycle to change the behavior of the
default point type in the PostgreSQL adapter. The old behavior will
continue to be available for the immediate future as `:legacy_point`.
The current behavior of returning an `Array` causes several problems,
the most significant of which is that we cannot differentiate between an
array of points, and a point itself in the case of a column with the
`point[]` type.
The attributes API gives us a reasonable way to have a proper
deprecation cycle for this change, so let's take advantage of it. If we
like this change, we can also add proper support for the other geometric
types (line, lseg, box, path, polygon, and circle), all of which are
just aliases for string today.
Fixes #20441
|
|/
|
|
| |
[Robin Dupret & Shunsuke Aida]
|
| |
|
| |
|
|
|
|
| |
Related with #17370.
|
| |
|
| |
|
|
|
|
|
| |
This line introduced by the commit fd398475 for using
`Arel::Visitors::BindVisitor`. Currently it is not used.
|
|\
| |
| | |
Avoid the heredoc in one line queries and simple queries
|
| |
| |
| |
| | |
Related with #20028.
|
|/ |
|
|\
| |
| | |
Add schema cache to new connection pool after fork
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Active Record detects when the process has forked and automatically
creates a new connection pool to avoid sharing file descriptors.
If the existing connection pool had a schema cache associated with it,
the new pool should copy it to avoid unnecessarily querying the database
for its schema.
The code to detect that the process has forked is in ConnectionHandler,
but the existing test for it was in the ConnectionManagement test file.
I moved it to the right place while I was writing the new test for this
change.
|
|\ \
| | |
| | | |
Divide methods for handling column options separately
|
| |/ |
|
|\ \
| | |
| | | |
Fix `serial?` with quoted sequence name
|
| |/ |
|
|/
|
|
|
|
|
|
|
| |
This patch
- reduces the duplication among the `reference`-family methods.
- better explains all the optians available for `add_reference`.
- redirects to user from `references` to `add_reference`.
Originated by #20184.
|
|\
| |
| | |
Reducing AR::ConPool's critical (synchronized) section
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Renamed `@reserved_connections` -> `@thread_cached_conns`. New name
clearly conveys the purpose of the cache, which is to speed-up
`#connection` method.
The new `@thread_cached_conns` now also uses `Thread` objects as keys
(instead of previously `Thread.current.object_id`).
Since there is no longer any synchronization around
`@thread_cached_conns`, `disconnect!` and `clear_reloadable_connections!`
methods now pre-emptively obtain ownership (via `checkout`) of all
existing connections, before modifying internal data structures.
A private method `release` has been renamed `thread_conn_uncache` to
clear-up its purpose.
Fixed some brittle `thread.status == "sleep"` tests (threads can go
into sleep even without locks).
|
| | |
|
| |
| |
| |
| | |
Move post checkout connection verification out of mutex.synchronize.
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
Its already doc'ed in
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
|
|\
| |
| | |
make AbstractAdapter#subquery_for private
|
| | |
|
|\ \
| | |
| | | |
Use `select_value` for avoid `ActiveRecord::Result` instance creating
|
| | |
| | |
| | |
| | |
| | | |
`exec_query` create `ActiveRecord::Result` instance. It is better to use
`select_value` instead of `exec_query` for performance.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
kamipo/use_select_rows_instead_of_select_one_in_select_values
Use `select_rows` instead of `select_one` in `select_value`
|
| |/ /
| | |
| | |
| | |
| | | |
`select_one` create `ActiveRecord::Result` instance. It is better to use
`select_rows` instead of `select_one` for performance.
|
|\ \ \
| |/ /
|/| | |
Apply schema cache dump when creating connections
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The `db:schema:cache:dump` rake task dumps the database schema structure
to `db/schema_cache.dump`. If this file is present, the schema details
are loaded into the currently checked out connection by a railtie while
Rails is booting, to avoid having to query the database for its schema.
The schema cache dump is only applied to the initial connection used to
boot the application though; other connections from the same pool are
created with an empty schema cache, and still have to load the structure
of each table directly from the database.
With this change, a copy of the schema cache is associated with the
connection pool and applied to connections as they are created.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
MySQL does not support partial index. And, the create index algorithm in
create table can not be specified.
|
|\ \ \
| | | |
| | | |
| | | | |
Correctly dump `:options` on `create_table` for MySQL
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
PostgreSQL: `:collation` support for string and text columns
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Example:
create_table :foos do |t|
t.string :string_en, collation: 'en_US.UTF-8'
t.text :text_ja, collation: 'ja_JP.UTF-8'
end
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Some databases like MySQL allow defining collation charset for specific
columns.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Change the `visit_AddColumn` visiblity for the internal API
|
| | | | | | |
|
| |/ / / /
|/| | | | |
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Move comment about microseconds [ci skip]
|