aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Merge pull request #16037 from sgrif/sg-money-quotingRafael Mendonça França2014-07-041-0/+24
|\ | | | | Remove unneccessary special case for money in quoting
| * Remove unneccessary special case for money in quotingSean Griffin2014-07-031-0/+24
| |
* | Merge pull request #16036 from sgrif/sg-datetime-infinityRafael Mendonça França2014-07-031-0/+44
|\ \ | | | | | | Do not rely on the column type when quoting infinity
| * | Do not rely on the column type when quoting infinitySean Griffin2014-07-031-0/+44
| |/
* / Use the type object for type casting HStore columnsSean Griffin2014-07-031-11/+5
|/
* Quote range strings when quoting PG rangesSean Griffin2014-07-022-1/+18
| | | | | 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 SQL injection when querying against ranges and bitstringsRafael Mendonça França2014-07-021-0/+11
| | | | Fix CVE-2014-3483 and protect against CVE-2014-3482.
* Use the type object for sending JSON to the databaseSean Griffin2014-06-291-1/+1
|
* [Postgresql tests] remove duplicate helperAbdelkader Boudih2014-06-281-12/+3
|
* Consolidate testing of update_all type castingSean Griffin2014-06-263-30/+0
| | | | | | | | | | | | | | We have several test cases on "tricky" types that are essentially testing that `update_all` goes through the same type casting behavior as a normal assignment + save. We recently had another case to add this test for another type in https://github.com/rails/rails/pull/12742. Rather than testing this separately for every type which is "tricky" when round tripping, let's instead have a fairly exhaustive test that ensures we're getting the correct values at every step for `update_all`. Given the structure of the code now, we can be confident that if the type is correct, and `update_all` is type casting correctly, we're going to get the right behavior for all types.
* Reconnect after possibly enabling hstoreMatthew Draper2014-06-181-0/+2
|
* Merge pull request #15782 from sgrif/sg-column-defaultsMatthew Draper2014-06-187-23/+12
|\ | | | | Don't type cast the default on the column
| * Don't type cast the default on the columnSean Griffin2014-06-177-23/+12
| | | | | | | | | | | | | | 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.
* | Detect in-place changes on point typesSean Griffin2014-06-171-0/+11
| |
* | Enable hstore in array testsSean Griffin2014-06-171-0/+6
| |
* | Detect mutations of arrays and array membersSean Griffin2014-06-171-0/+23
| |
* | Ensure `OID::Array#type_cast_for_database` matches PG's quoting behaviorSean Griffin2014-06-172-0/+33
|/ | | | | | 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)
* Don't assume that Hstore columns have always changedSean Griffin2014-06-172-1/+3
| | | | | | | | | 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.
* Merge pull request #15674 from sgrif/sg-mutable-attributesMatthew Draper2014-06-142-0/+29
|\ | | | | Detect in-place changes on mutable AR attributes
| * Detect in-place changes on mutable AR attributesSean Griffin2014-06-132-0/+29
| | | | | | | | | | | | We have several mutable types on Active Record now. (Serialized, JSON, HStore). We need to be able to detect if these have been modified in place.