| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
While investigating #16951 I found that another library's monkey-patching of
`Enumerable` was causing the test migrations helper to break when trying to
build the `CREATE DATABASE` statement. The prior approach used `#sum` to build
the string from the options hash.
As the code that combines the options to build the database statement is not
user-facing, using `#inject` here instead will remove the only place where the
database creation/migration code is dependent on ActiveSupport's monkey-patching
of `Enumerable`.
|
|
|
|
|
|
| |
Closes #16907.
[Matthew Draper & Yves Senn]
|
|
|
|
|
| |
TableDefinition#column is not called from `add_column`.
Use TableDefinition#new_column_definition for column option handling.
|
|
|
|
|
|
|
|
|
|
| |
Using heredoc would enforce line wrapping to whatever column width we decided to
use in the code, making it difficult for the users to read on some consoles.
This does make the source code read slightly worse and a bit more error-prone,
but this seems like a fair price to pay since the primary purpose for these
messages are for the users to read and the code will not stick around for too
long.
|
|
|
|
|
|
|
|
|
| |
This is a reacon to https://github.com/rails/rails/commit/d6c1205584b1ba597db4071b168681678b1e9875#commitcomment-7502487
This backwards incompatibility was introduced with d6c12055 to fix #7516.
However both `connection.default_sequence_name` and `model.sequence_name` are public API.
The PostgreSQL adapter should honor the interface and return strings.
/cc @matthewd @chancancode
|
|
|
|
|
| |
* Require either FIRST or LAST qualifier for "NULLS ..."
* Require whitespace before "NULLS ..."
|
|
|
|
| |
Fixes #16623 introduced by https://github.com/rails/rails/commit/3d5a2019bcccc6fb01bee4811ca669f4383edb51
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The method has been removed in 09206716f8695f6b8467f15c1befa5a4c3c10978
(PR #16074), but the delegation was apparently missed, and one instance
of the method was added back with the addition of OID::Xml in
336be2bdf7dfa1b31879d0ab27e5f3101b351923 (PR #16072), so we can safely
rm both.
|
|
|
|
| |
[Philippe Creux, Chris Teague]
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes #16261.
[Matthew Draper, Yves Senn]
Using `DEFAULT NULL` results in the same behavior as `DROP DEFAULT`.
However, PostgreSQL will cast the default to the columns type,
which leaves us with a default like "default NULL::character varying".
/cc @matthewd
|
| |
|
| |
|
|\
| |
| | |
Remove PG's definition of `type_cast`
|
| |
| |
| |
| |
| | |
All cases except for `nil` in an array have been removed. `nil` in an
array is handled by the Array type object.
|
|\ \
| | |
| | | |
Don't rely on the sql type to quote XML columns in PG
|
| |/ |
|
|/
|
|
|
|
|
| |
This was only used for uniqueness validations. The first usage was in
conjunction with `limit`. Types which cast to string, but are not
considered text cannot have a limit. The second case was only with an
explicit `:case_sensitive => true` option given by the user.
|
| |
|
|\
| |
| | |
Remove unneccessary special case for money in quoting
|
| | |
|
|\ \
| | |
| | | |
Do not rely on the column type when quoting infinity
|
| |/ |
|
|/ |
|
|
|
|
|
| |
The test case for CVE-2014-3483 doesn't actually send the generated SQL
to the database. The generated SQL is actually invalid for real inputs.
|
|
|
|
| |
Fix CVE-2014-3483 and protect against CVE-2014-3482.
|
|\
| |
| | |
Remove array workaround in PG quoting
|
| |
| |
| |
| |
| | |
We no longer need to do fancy legwork to make sure arrays use a type
object, now that schema methods use a real type object.
|
|/
|
|
|
| |
Hstore no longer needs additional quoting to be used in an array, the
array type handles it sufficiently.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The only case where we got a column that was not `nil`, but did not
respond to `cast_type` was when type casting the default value during
schema creation. We can look up the cast type, and add that object to
the column definition. Will allow us to consistently rely on the type
objects for type casting in all directions.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Adding `# :nodoc:` to the parent `class` / `module` is not going
to ignore nested classes or modules.
There is a modifier `# :nodoc: all` but sadly the containing class
or module will continue to be in the docs.
/cc @sgrif
|
|
|
|
|
|
|
|
|
| |
We're never going to be able to use the attribute object here, however,
so let's just accept the ugly demeter violation here for now.
Remove test cases which were either redundant with other tests in the
file, or were actually testing the type objects (which are tested
elsewhere)
|
| |
|
| |
|
|
|
|
|
|
| |
Also takes a step towards supporting types which use a character other
than ',' for the delimiter (`box` is the only built in type for which
this is the case)
|
|\
| |
| | |
Move pg array database type casting to the Array type
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The case where we have a column object, but don't have a type cast
method involves type casting the default value when changing the schema.
We get one of the column definition structs instead. That is a case that
I'm trying to remove overall, but in the short term, we can achieve the
same behavior without needing to pass the adapter to the array type by
creating a fake type that proxies to the adapter.
|
|/
|
|
|
|
|
|
|
| |
HStore columns come back from the database separated by a comma and a
space, not just a comma. We need to mirror that behavior since we
compare the two values.
Also adds a regression test against JSON to ensure we don't have the
same bug there.
|