aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* prefer `drop_table if_exists: true` over raw SQL.Yves Senn2015-02-187-7/+7
| | | | | | | /cc @yahonda This makes it easier for third party adapters to run our tests, even if that database does not support IF EXISTS.
* `type_cast_from_user` -> `cast`Sean Griffin2015-02-172-5/+5
|
* `type_cast_for_database` -> `serialize`Sean Griffin2015-02-176-17/+17
|
* `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-176-24/+24
|
* Extract `DateTimePrecisionTest`Ryuta Kamizono2015-02-131-100/+0
| | | | The datetime precision tests for any adapters is duplicated.
* pg tests, be clear about the missing type that causes a test skip.Yves Senn2015-02-121-7/+6
| | | | Also removed some cruft in the `setup` and `teardown` methods.
* The datetime precision with zero should be dumpedRyuta Kamizono2015-02-111-22/+39
| | | | | `precision: 0` was not dumped by f1a0fa9e19b7e4ccaea191fc6cf0613880222ee7. However, `precision: 0` is valid value for PostgreSQL timestamps.
* Refactor microsecond precision to be database agnosticSean Griffin2015-02-102-5/+3
| | | | | | | | | | The various databases don't actually need significantly different handling for this behavior, and they can achieve it without knowing about the type of the object. The old implementation was returning a string, which will cause problems such as breaking TZ aware attributes, and making it impossible for the adapters to supply their logic for time objects.
* Fix rounding problem for PostgreSQL timestamp columnRyuta Kamizono2015-02-081-0/+16
| | | | | If timestamp column have the precision, it need to format according to the precision of timestamp column.
* Remove unused lineRyuta Kamizono2015-02-081-1/+0
|
* rm `Type#number?`Sean Griffin2015-02-0714-19/+0
| | | | | This predicate is only used in `query_attribute`, and is relatively easy to remove without adding a bunch of is a checks.
* Fix test cases for money, bit and bit_varyingMelody2015-02-042-2/+4
|
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-0317-17/+0
| | | | onwards.
* Remove most type related predicates from `Column`Sean Griffin2015-01-3015-70/+107
| | | | | | Remaining are `limit`, `precision`, `scale`, and `type` (the symbol version). These will remain on the column, since they mirror the options to the `column` method in the schema definition DSL
* Remove Relation#bind_paramsSean Griffin2015-01-274-13/+24
| | | | | | | | `bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
* Fix test failure on PG caused by 7c6f3938dee47f093Sean Griffin2015-01-231-2/+2
|
* Don't error when invalid json is assigned to a JSON columnSean Griffin2015-01-211-0/+8
| | | | | | | Keeping with our behavior elsewhere in the system, invalid input is assumed to be `nil`. Fixes #18629.
* Should escape regexp wildcard character `.`Ryuta Kamizono2015-01-1911-14/+14
| | | | | `.` is regexp meta character. It should be escape for `assert_match` correctly.
* Stop passing a column to `quote` in testsSean Griffin2015-01-101-4/+5
| | | | | | | I'm planning on deprecating the column argument to mirror the deprecation in [arel]. [arel]: https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
* remove deprecated support for PG ranges with exclusive lower bounds.Yves Senn2015-01-051-27/+5
| | | | addresses https://github.com/rails/rails/commit/91949e48cf41af9f3e4ffba3e5eecf9b0a08bfc3#commitcomment-9144563
* Prefer `array?` rather than `array`Ryuta Kamizono2015-01-0414-20/+20
| | | | | | Slightly refactoring `PostgreSQLColumn`. `array` should be readonly. `default_function` should be initialized by `super`. `sql_type` has been removed `[]`. Since we already choose to remove it we should not change.
* Stop depending on columns for type information in PG quoting testsSean Griffin2015-01-012-30/+29
| | | | | | | | A few of the tests weren't testing anything of value. The IP Address tests are testing the type, not behavior of the connection adapter. There are two CVE regression tests which are important, but don't have a good place to go, so I've left them alone for now, as they call `quote` and the focus right now is removing `column` from `type_cast`
* Ensures that primary_key method will return nil when multi-pkArthur Neves2014-12-301-0/+6
| | | | | | | When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
* Go through normal `where` logic when preloading associationsSean Griffin2014-12-261-1/+1
| | | | | | | | | | This will allow eager type casting to take place as needed. There doesn't seem to be any particular reason that the `in` statement was forced for single values, and the commit message where it was introduced gives no context. See https://github.com/rails/rails/commit/d90b4e2615e8048fdeffc6dffe3246704adee01f
* Correctly ignore `case_sensitive` for UUID uniqueness validationSean Griffin2014-12-261-0/+17
| | | | | | | | I think we should deprecate this behavior and just error if you tell us to do a case insensitive comparison for types which are not case sensitive. Partially reverts 35592307 Fixes #18195
* Dump the default `nil` for PostgreSQL UUID primary key.Ryuta Kamizono2014-12-261-0/+6
|
* Add `force: true` to table created in testsSean Griffin2014-12-221-1/+1
| | | | | | If the test is interrupted in a way that the teardown block fails to run, the tests will fail to run until the table is removed manually without this option.
* Correctly handle limit on int4 and int8 types in PGSean Griffin2014-12-221-0/+25
| | | | | | | | | | | | | | | | PG doesn't register it's types using the `int(4)` format that others do. As such, if we alias `int8` to the other integer types, the range information is lost. This is fixed by simply registering it separately. The other option (which I specifically chose to avoid) is to pass the information of the original type that was being aliased as an argument. I'd rather avoid that, since an alias should truly be treated the same. If we need different behavior for a different type, we should explicitly register it with that, and not have a conditional based on aliasing. Fixes #18144 [Sean Griffin & ysbaddaden]
* `force: :cascade` to recreate tables referenced by foreign-keys.Yves Senn2014-12-191-1/+1
|
* Relax the UUID regexGodfrey Chan2014-12-181-3/+7
| | | | | | | | Apparently PG does not validate against RFC 4122. The intent of the original patch is just to protect against PG errors (which potentially breaks txns, etc) because of bad user input, so we shouldn't try any harder than PG itself. Closes #17931
* Update test case for TZ aware attributesSean Griffin2014-12-081-4/+14
| | | | | | The test added in 42418cfc94d1356d35d28d786f63e7fab9406ad6 wasn't actually testing anything, since the bug was with TZ aware attributes only.
* Allow custom handling of non-standard types in `time_zone_conversion`Sean Griffin2014-12-081-0/+6
| | | | | | | | | | | | PostgreSQL for example, allows infinity as a valid value for date time columns. The PG type has explicit handling for that case. However, time zone conversion will end up trampling that handling. Unfortunately, we can't call super and then convert time zones. However, if we get back nil from `.in_time_zone`, it's something we didn't expect so we can let the superclass handle it. Fixes #17971
* Revert to 4.1 behavior for casting PG arraysSean Griffin2014-12-081-5/+20
| | | | | | | | | | The user is able to pass PG string literals in 4.1, and have it converted to an array. This is also possible in 4.2, but it would remain in string form until saving and reloading, which breaks our `attr = save.reload.attr` contract. I think we should deprecate this in 5.0, and only allow array input from user sources. However, this currently constitutes a breaking change to public API that did not go through a deprecation cycle.
* Add `force: true` to tables created in PG testsSean Griffin2014-12-052-2/+2
| | | | | | If the tests are interupted and the teardown block doesn't run, the developer needs to delete these manually in order to be able to run the tests again.
* Correctly respect subtypes for PG arrays and rangesSean Griffin2014-12-051-0/+18
| | | | | | | | | | | | | The type registration was simply looking for the OID, and eagerly fetching/constructing the sub type when it was registered. However, numeric types have additional parameters which are extracted from the actual SQL string of the type during lookup, and can have their behavior change based on the result. We simply need to use the block form of registration, and look up the subtype lazily instead. Fixes #17935
* pg tests, get rid of global schema `schema_1`.Yves Senn2014-12-021-1/+51
|
* pg tests, move uniqueness validation test to array tests.Yves Senn2014-12-021-0/+15
|
* tests, extract pg number tests into separate file.Yves Senn2014-12-022-35/+50
|
* tests, move schema shorthand assertions into pg specific tests.Yves Senn2014-12-028-5/+86
|
* tests, move pg geometric tests out of `base_test`.Yves Senn2014-12-021-6/+73
|
* ugh, forgot to add this test to cdd90f39d796986dabf1678b3277b230dbe18961Aaron Patterson2014-12-011-0/+5
|
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-292-4/+2
|
* oops, forgot to add the real assertion!Aaron Patterson2014-11-241-0/+1
|
* allow the "USING" statement to be specified on change column callsAaron Patterson2014-11-241-0/+25
|
* Rename the primary key index when renaming a table in pgSean Griffin2014-11-221-0/+34
| | | | | | | | Also checked to make sure this does not affect foreign key constraints. (It doesn't). Fixes #12856 Closes #14088
* Remove the unused second argument to `substitute_at`Sean Griffin2014-11-171-1/+1
| | | | Oh hey, we got to remove some code because of that!
* rm `reorder_bind_params`Sean Griffin2014-11-171-4/+1
| | | | | | Arel handles this for us automatically. Updated tests, as BindParam is no longer a subclass of SqlLiteral. We should remove the second argument to substitute_at entirely, as it's no longer used
* Build fix when running in isolationArun Agrawal2014-11-141-0/+1
| | | | | `Computer` class needs to be require See #17217 for more details
* pg tests, get rid of `sql_types_test.rb`.Yves Senn2014-11-073-18/+14
|
* pg tests, only execute what's necessary.Yves Senn2014-11-072-27/+26
|