| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
`visit_ChangeColumnDefinition` is the same "CHANGE column_name " + `visit_ColumnDefinition(o)`.
|
|
|
|
|
| |
In most cases, `create_table_definition` called by table_name (the first
argument) only.
|
|\
| |
| |
| | |
Clear query cache on rollback
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Improve a dump of the primary key support.
Conflicts:
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | | |
If it is not a default primary key, correctly dump the type and options.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
kamipo/format_datetime_string_according_to_precision
Format the datetime string according to the precision of the datetime field.
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Incompatible to rounding behavior between MySQL 5.6 and earlier.
In 5.5, when you insert `2014-08-17 12:30:00.999999` the fractional part
is ignored. In 5.6, it's rounded to `2014-08-17 12:30:01`:
http://bugs.mysql.com/bug.php?id=68760
|
|/ / / |
|
| | | |
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| | |
Example:
create_table :foos, id: :bigint do |t|
end
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When running the following migration:
change_table(:table_name) { |t| t/timestamps }
The following error was produced:
wrong number of arguments (2 for 1) .... /connection_adapters/abstract/schema_statements.rb:851:in `remove_timestamps'
This is due to `arguments` containing an empty hash as its second
argument.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
AbstractMysqlAdapter
|
| |
|
|\
| |
| |
| |
| | |
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
|
|/ |
|
|
|
|
|
|
| |
it doesn't work on SQLite3 since it doesn't support truncate, but that's
OK. If you call truncate on the connection, you're now bound to that
database (same as if you use hstore or any other db specific feature).
|
| |
|
| |
|
|
|
|
|
|
|
| |
`AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on
in adapter subclasses. Currently the flag only controls test execution.
/cc @yahonda
|
| |
|
|
|
|
|
|
|
| |
Method .strip_heredoc is defined in
active_support/core_ext/string/strip.rb so we need to require it.
[fixes #16677]
|
|
|
|
|
|
|
|
|
|
| |
Sets the connection collation to the database collation configured
in database.yml. Otherwise, `SET NAMES utf8mb4` will use the default
collation for that charset (utf8mb4_general_ci) when you may have chosen
a different collation, like utf8mb4_unicode_ci.
This only applies to literal string comparisons, not column values, so
it is unlikely to affect you.
|
|
|
|
|
|
|
| |
As per discussion, this changes the model generators to specify
`null: false` for timestamp columns. A warning is now emitted if
`timestamps` is called without a `null` option specified, so we can
safely change the behavior when no option is specified in Rails 5.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We default to making the connection strict, but have historically relied
on the MySQL default when we want it to be non-strict. On some (recent?)
versions of MySQL, new connections default to being strict, so if we've
been told 'strict:false', we're obliged to pass that on.
This fixes a test failure that we've seen turn up on relatively-new
development machines, so we do already have a test covering it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|