aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/array_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure time zones don't change after round trip with array columnsSean Griffin2014-06-071-0/+2
| | | | | The times would be equivalent, even if they were in different time zones. E.g. 12:00 UTC == 5:00 PDT
* Don't rely on `Time.current` in testsSean Griffin2014-06-071-5/+10
| | | | Millisecond inequality causes failures on Travis
* Add array support when time zone aware attributes are enabledSean Griffin2014-06-071-0/+16
|
* Revert "test pg, we don't care about the internal state of `column#default`."Yves Senn2014-06-031-0/+4
| | | | | | | | | | | | | | Revert "test pg, remove unused column assignments. Follow up to 254cdf47" Related to #15492 This reverts commit 254cdf4728291277f3fbaa854f34495030e476b4. This reverts commit 4bcf9029452e0c760af04faab6b549710401e8cf. There are public methods that assume `Column#default` is type casted. The return value of `Column#default` is publicly relevant and should not change. /cc @sgrif
* test pg, remove unused column assignments. Follow up to 254cdf47Yves Senn2014-06-031-2/+0
|
* test pg, rm unused requires.Yves Senn2014-06-031-2/+0
|
* test pg, we don't care about the internal state of `column#default`.Yves Senn2014-06-031-2/+0
| | | | | That data is internal to Active Record. What we care about is that new records have the right default value.
* Rename `oid_type` to `cast_type` to make PG columns consistentSean Griffin2014-05-211-10/+1
|
* test, move all pg array tests into `postgresql/array_test.rb`.Yves Senn2014-05-131-5/+28
|
* test, use `columns_hash[]` in place of `columns.find {}`.Yves Senn2014-05-121-2/+2
|
* pg, `change_column_default` accepts `[]`. Closes #11586.Yves Senn2014-05-121-1/+9
|
* PostgreSQL and SQLite, remove varchar limit. [Vladimir Sazhin & Toms Mikoss ↵Yves Senn2014-04-041-1/+1
| | | | | | | | | | | | | | | | & Yves Senn] There is no reason for the PG adapter to have a default limit of 255 on :string columns. See this snippet from the PG docs: Tip: There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.
* fix bug on non empty defaults for pg array columnsLuke Steensen2014-03-301-0/+11
| | | | fixes #10613
* PostgreSQL, test-cases to lock down column default values.Yves Senn2014-03-281-0/+11
|
* PostgreSQL, test cases to lock the current column types.Yves Senn2014-03-281-0/+3
|
* Use teardown helper method.Guo Xiang Tan2014-03-141-1/+1
| | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
* Fixes issue with parsing whitespace content back from database - fixes #13907Mauricio Linhares2014-02-011-0/+12
|
* Tidy up fix for PG extensions quotingCarlos Antonio da Silva2013-12-231-2/+6
| | | | | Always pass in the column for quote_bound_value and quote using it in case it exists there.
* Serialize postgres' hstore, json and array types correctly in AR update methods.Tadas Tamosauskas2013-12-231-0/+6
| | | | | | | | | Fixes #12261. Closes #12395. Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/adapters/postgresql/array_test.rb activerecord/test/cases/adapters/postgresql/json_test.rb
* Do not consider PG array columns as number or text columnsCarlos Antonio da Silva2013-12-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | The code uses these checks in several places to know what to do with a particular column, for instance AR attribute query methods has a branch like this: if column.number? !value.zero? end This should never be true for array columns, since it would be the same as running [].zero?, which results in a NoMethodError exception. Fixing this by ensuring that array columns in PostgreSQL never return true for number?/text? checks. Since most of the array support was based on the postgres_ext lib, it's worth noting it does the same thing for numeric array columns too: https://github.com/dockyard/postgres_ext/blob/v1.0.0/lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb#L72 This extended the same logic for text columns to ensure consistency.
* fix quoting non-stringsDamien Mathieu2013-12-221-0/+6
| | | | Closes #13444
* Fix indent in PG array testsCarlos Antonio da Silva2013-12-191-5/+5
| | | | [ci skip]
* short arrays in inspectJan Bernacki2013-10-301-0/+5
|
* Fix multidimensional PG arrays containing non-string itemsYves Senn2013-08-071-14/+19
|
* test to express that we can't turn non-array columns to array columns.Yves Senn2013-08-061-0/+9
| | | | Closes #11062
* `change_column` for PG adapter respects `:array` option.Yves Senn2013-07-161-0/+12
|
* Fix loading of fixtures when the column type is a postgres array of strings.Chris Constantine2013-04-181-0/+6
| | | | - A string in an array of strings that has a quote char (') needs to have that quote char escaped if the array is getting wrapped in quote chars.
* Revert "Merge pull request #10043 from cconstantine/master"Rafael Mendonça França2013-04-181-6/+0
| | | | | | | This reverts commit 521035af530482d6d9ad2dae568eaeb0ab188e1c, reversing changes made to 222011dbee842bbc60d3aaaa3145356b90a30fd1. Reason: This broke the tests
* Fix loading of string arrays in postgresChris Constantine2013-04-081-0/+6
|
* Moves column dump specific code to a module included in AbstractAdapterDan McClain2012-09-141-0/+98
Having column related schema dumper code in the AbstractAdapter. The code remains the same, but by placing it in the AbstractAdapter, we can then overwrite it with Adapter specific methods that will help with Adapter specific data types. The goal of moving this code here is to create a new migration key for PostgreSQL's array type. Since any datatype can be an array, the goal is to have ':array => true' as a migration option, turning the datatype into an array. I've implemented this in postgres_ext, the syntax is shown here: https://github.com/dockyard/postgres_ext#arrays Adds array migration support Adds array_test.rb outlining the test cases for array data type Adds pg_array_parser to Gemfile for testing Adds pg_array_parser to postgresql_adapter (unused in this commit) Adds schema dump support for arrays Adds postgres array type casting support Updates changelog, adds note for inet and cidr support, which I forgot to add before Removing debugger, Adds pg_array_parser to JRuby platform Removes pg_array_parser requirement, creates ArrayParser module used by PostgreSQLAdapter