aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* tests, remove unneeded requires.Yves Senn2014-11-064-11/+0
|
* tests, use SchemaDumpingHelper to dump a specific table.Yves Senn2014-11-061-12/+12
| | | | | This makes debugging the generated schema output much easier. As a side effect it also shaves off 2.5 seconds of test runtime.
* Added SchemaDumper support for tables with jsonb columns.Ted O'Meara2014-11-041-0/+8
|
* fix set_pk_sequence and add a test for it.Aaron Patterson2014-10-311-0/+8
|
* add bigserial pk supportAaron Patterson2014-10-291-0/+20
|
* pg, test assigning non-array values to an array column. Closes #14716.Yves Senn2014-10-161-0/+9
| | | | | | The behavior has changed since 4.1 and non-array values are no longer type casted to a blank array. This way the user can define custom validations on that property.
* add a truncate method to the connectionAaron Patterson2014-09-221-0/+10
| | | | | | 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).
* pg, correctly dump foreign keys targeting tables in a different schema.Yves Senn2014-09-171-0/+26
| | | | | | Closes #16907. [Matthew Draper & Yves Senn]
* pg, add test cases for updateable views.Yves Senn2014-09-111-0/+45
|
* reuse view test-cases for pg materialized view tests.Yves Senn2014-09-111-58/+9
|
* Added enable_extension! to helperAbdelkader Boudih2014-09-054-21/+11
|
* Don't test PostgreSQL implementation detailsAkira Matsuda & Kohei Suzuki2014-08-291-3/+0
| | | | | Asserting that the message contains "QUERY PLAN" is enough for the adapter's test. The plan may vary according to number of tuples etc. but that's out of our concern.
* pg, `default_sequence_name` needs to return a string.Yves Senn2014-08-251-6/+6
| | | | | | | | | 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
* Don't trim excess whitespace in pg #columns_for_distinctAgis-2014-08-241-0/+8
| | | | Fixes #16623 introduced by https://github.com/rails/rails/commit/3d5a2019bcccc6fb01bee4811ca669f4383edb51
* adding the exception RecordNotFound to UUID findJoseLuis Torres2014-08-211-0/+14
|
* Change the default `null` value for timestampsSean Griffin2014-08-121-4/+4
| | | | | | | 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.
* Add support for Postgresql JSONBPhilippe Creux2014-07-241-9/+25
| | | | [Philippe Creux, Chris Teague]
* Allow to specify a type for foreign key column in migrationsAndrey Novikov2014-07-221-1/+1
| | | | [Andrey Novikov & Łukasz Sarnacki]
* Treat invalid uuid as nilAbdelkader Boudih2014-07-141-0/+37
|
* Dump PostgreSQL primary key with custom function as a default.Andrey Novikov2014-07-111-0/+23
| | | | | | | | | | | For example, if use pgcrypto extension in PostgreSQL 9.4 beta 1, where uuid-ossp extension isn't available for moment of writing, and thus to use a gen_random_uuid() method as a primary key default. In this case schema dumper wasn't able to correctly reconstruct create_table statement and lost primary key constraint on schema load. Fixes #16111.
* Merge pull request #16072 from sgrif/sg-xml-quotingRafael Mendonça França2014-07-081-1/+14
|\ | | | | Don't rely on the sql type to quote XML columns in PG
| * Don't rely on the sql type to quote XML columns in PGSean Griffin2014-07-061-1/+14
| |
* | Remove the `text?` predicate from the type objectsSean Griffin2014-07-0614-18/+0
|/ | | | | | | 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.
* Use the type object for quoting PG RangesSean Griffin2014-07-052-6/+6
|
* Fix typoRafael Mendonça França2014-07-041-1/+1
|