| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| | | |
| | | | |
`join_to_delete` is same as `join_to_update`
|
| | | |
| | | |
| | | |
| | | | |
Reapply #22615.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Follow up to #22642.
|
| |_|/
|/| | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
byroot/do-not-include-column-limit-if-it-is-default
Do not include column limit in schema.rb if it matches the default
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When working on engines that supports multiple databases, it's
very annoying to have a different schema.rb output based on which
database you use. MySQL being the primary offender.
This patch should reduce the disparities a bit.
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Support passing the schema name prefix to `conenction.indexes`
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | | |
Support passing the schema name as a prefix to table name in
`ConnectionAdapters::SchemaStatements#indexes`. Previously the prefix would
be considered a full part of the index name, and only the schema in the
current search path would be considered.
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Ignore index name in `index_exists?` when not passed a name to check for
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | | |
Remove legacy mysql adapter
|
| | |/ / /
| |/| | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
Since the attributes API is new in Rails 5, we don't actually need to keep
the behavior of `attribute :point`, as it's not a breaking change.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
kamipo/join_to_delete_is_same_as_join_to_update"
This reverts commit 4d06ea9a829de8f6f5a345589828e182eacab6a3, reversing
changes made to e9d15072a94e2ae4dec5b7a121c84a5db38547b8.
Reason: This will break oracle-enhanced, see
https://github.com/rsim/oracle-enhanced/blob/3c42131db82b64ac41645db3affc6e4650289df6/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L1254
|
| |_|/
|/| | |
|
|\ \ \
| |/ /
|/| | |
Allow users to pass flags from database.yml
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fix white-space
Add test case demonstrating flags are received by the adapter
|
| | |
| | |
| | |
| | |
| | | |
Even though this means more things to change when we bump after a
release, it's more important that our examples are directly copyable.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If we use a real version, at best that'll be an onerous update required
for each release; at worst, it will encourage users to write new
migrations against an older version than they're using.
The other option would be to leave these bare, without any version
specifier. But as that's just a variant spelling of "4.2", it would seem
to raise the same concerns as above.
|
|\ \ \
| |/ /
|/| | |
Use adapter supports_datetime_with_precision
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Explain the connection pool error message better [ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The previous message was misleading (especially for Ops guys) when
diagnosing problems related to the database connection.
The message was suggesting that the connection cannot be obtained which
normally assumes the need to look at the database.
But this isn't the case as the connection could not be retrieved from
the application's internal connection pool.
The new message should make it more explicit and remove the confusion.
|
|/ /
| |
| |
| | |
`pool` in args is unused anymore. And `config` is used in all adapters.
|
| |
| |
| |
| | |
Not needed for `Mysql2Adapter` and `AbstractMysqlAdapter`.
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
kamipo/schema_dumping_support_for_postgresql_geometric_types
Add schema dumping support for PostgreSQL geometric data types
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
kamipo/not_passing_native_database_types_to_table_definition
Not passing `native_database_types` to `TableDefinition`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The `native_database_types` only used in `TableDefinition` for look up
the default `:limit` option. But this is duplicated process with
`type_to_sql`. Passing `native_database_types` is not needed.
|
| |/ /
|/| |
| | |
| | | |
Not needed for `Mysql2Adapter` and `AbstractMysqlAdapter`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 8246b593bff71f2cebf274c133bb8917f1e094c8.
There was concern about this modifying the behavior of past migrations.
We're going to add an way to modify the migration generator instead.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's often the case that you want to have an option that you cannot
specify at the database level, but want applied to *all* tables that you
create. For example, you might want to specify `ROW_FORMAT=DYNAMIC` to
not have to limit text columns to length 171 for indexing when using
utf8mb4. This allows an easy way to specify this in your database
configuration.
While this change affects both MySQL and MySQL2, the test only covers
MySQL2, as the legacy mysql adapter appears to always return ASCII
strings, and is tangential to what we're actually doing.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- key was a poor choice of name. A key implies something that will
unlock a lock. The concept is actually more like a 'lock identifier'
- mysql documentation calls this a 'lock name'
- postgres documentation calls it a 'lock_id'
- Updated variable names to reflect the preferred terminology for the database in
question
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reported on #21509, how views is treated by `#tables` are differ
by each adapters. To fix this different behavior, after Rails 5.0
is released, deprecate `#tables`.
And `#table_exists?` would check both tables and views.
To make their behavior consistent with `#tables`, after Rails 5.0
is released, deprecate `#table_exists?`.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Columns are no longer stored in an attribute since b8a533d.
[ci skip]
|
| | |
|
| |
| |
| |
| | |
Such as #10404, #18206.
|
|\ \
| | |
| | |
| | |
| | | |
samphilipd/sam/manual_locking_on_schema_migrations
Make migrations concurrent safe (using advisory locks)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Addresses issue #22092
- Works on Postgres and MySQL
- Uses advisory locks because of two important properties:
1. The can be obtained outside of the context of a transaction
2. They are automatically released when the session ends, so if a
migration process crashed for whatever reason the lock is not left
open perpetually
- Adds get_advisory_lock and release_advisory_lock methods to database
adapters
- Attempting to run a migration while another one is in process will
raise a ConcurrentMigrationError instead of attempting to run in
parallel with undefined behavior. This could be rescued and
the migration could exit cleanly instead. Perhaps as a configuration
option?
Technical Notes
==============
The Migrator uses generate_migrator_advisory_lock_key to build the key
for the lock. In order to be compatible across multiple adapters there
are some constraints on this key.
- Postgres limits us to 64 bit signed integers
- MySQL advisory locks are server-wide so we have to scope to the
database
- To fulfil these requirements we use a Migrator salt (a randomly
chosen signed integer with max length of 31 bits) that identifies
the Rails migration process as the owner of the lock. We multiply
this salt with a CRC32 unsigned integer hash of the database name to
get a signed 64 bit integer that can also be converted to a string
to act as a lock key in MySQL databases.
- It is important for subsequent versions of the Migrator to use the
same salt, otherwise different versions of the Migrator will not see
each other's locks.
|
|\ \ \
| | | |
| | | | |
PostgreSQL, Replace static connection param list by libpq's dynamic list
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This makes the connection adapter future-proof regarding to new parameters.
To maintain backward compatibility, :requiressl is added by hand. It is
deprecated by PostgreSQL since 2003, but still accepted by libpq.
|
| | | | |
|