| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Making this change revealed several subtle bugs related to models with
no primary key, and anonymous classes. These have been fixed as well,
with regression tests added.
|
|
|
|
|
|
|
| |
If we want to have type decorators mess with the attribute, but not the
column, we need to stop type casting on the column. Where possible, we
changed the tests to test the value of `column_defaults`, which is
public API. `Column#default` is not.
|
| |
|
|
|
|
|
|
| |
We need to decorate the types lazily. This is extracted to a separate
API, as there are other refactorings that will be able to make use of
it, and to allow unit testing the finer points more granularly.
|
| |
|
|
|
|
|
|
| |
- Create a consistent API across adapters for building new columns
- Use it for custom properties so we don't get `UndefinedMethodError`s
in stuff I'm implementing elsewhere.
|
|
|
|
| |
This is already the behavior for `BigDecimal` in the abstract adapter.
|
| |
|
|
|
|
|
| |
Columns and injected types no longer have any conditionals based on the
format of SQL type strings! Hooray!
|
|
|
|
|
|
|
|
| |
All subclasses of column were now delegating `type_cast` to their
injected type object. We can remove the overriding methods, and
generalize it on the `Column` class itself. This also enabled us to
remove several column classes completely, as they no longer had any
meaningful behavior of their own.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The decision to wrap type registrations in a proc was made for two
reasons.
1. Some cases need to make an additional decision based on the type
(e.g. a `Decimal` with a 0 scale)
2. Aliased types are automatically updated if they type they point to is
updated later. If a user or another adapter decides to change the
object used for `decimal` columns, `numeric`, and `number` will
automatically point to the new type, without having to track what
types are aliased explicitly.
Everything else here should be pretty straightforward. PostgreSQL ranges
had to change slightly, since the `simplified_type` method is gone.
|
|
|
|
|
|
| |
Part of #15134. In order to perform typecasting polymorphically, we need
to add another argument to the constructor. The order was chosen to
match the `oid_type` on `PostgreSQLColumn`.
|
|
|
|
| |
double limits
|
| |
|
|
|
|
|
| |
column_for will raise in case column is not found for the given table,
so there is no need to handle that here.
|
| |
|
|
|
|
|
|
|
| |
For mysql2/mysql adapters, `sql_mode` variable name set in `database.yml`
as string, was ignored and `sql_mode` was set to use strict mode.
Fixes #14895
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
this lets arel know how to correctly quote the value
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* cache `o.name` value
* Avoid extra `concat` call
* Avoid extra `<<` call
|
|
|
|
|
|
|
|
| |
existence
Also:
- updates tests by stubbing table_exists? method
- adds entry for creating indexes in CREATE TABLE to changelog
|
|
|
|
|
|
|
|
| |
This is important, because adding an index on a temporary table after
it has been created would commit the transaction
Conflicts:
activerecord/CHANGELOG.md
|
|\
| |
| |
| |
| |
| |
| | |
Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation.
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| | |
case insensitive collation.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Blast from the past, MySQL 4 era, when the password hashing style changed.
|
| |
| |
| |
| |
| | |
also override drop_table in AbstractMySQLAdapter to properly drop
temporary tables without committing the transaction
|
| |
| |
| |
| | |
Since MySQL 5.7.3 m13 does now allow primary key column is null.
|
| |
| |
| |
| |
| | |
This method is not using the block variable directly since it is calling
yield
|
|\ \
| | |
| | | |
#type_cast - improve performance & readability
|
| |/ |
|
| |
| |
| |
| | |
also clarify native rename_index support is >= 5.7, not > 5.7
|
|/ |
|