aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/schema_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Support dropping indexes concurrently in PostgresGrey Baker2015-09-051-2/+2
| | | | | See http://www.postgresql.org/docs/9.4/static/sql-dropindex.html for more details.
* pg, `create_schema`, `drop_schema` and `rename_table` quote schema name.Yves Senn2015-08-281-7/+47
| | | | | | | | Closes #21418. Previously schema names were not quoted. This leads to issues when a schema names contains a ".". Methods in `schema_statements.rb` should quote user input.
* PostgreSQL, add `:if_exists` to `#drop_schema`.Yves Senn2015-08-281-10/+21
|
* Display decimal defaults as strings to keep precisionJohn Gesimondo2015-06-231-0/+5
|
* make it possible to run AR tests with bin/testYves Senn2015-06-111-3/+3
|
* PostgreSQL, Fix OID based type casts in C for primitive types.Lars Kanis2015-03-251-3/+3
| | | | | | | | | | The type map was introduced in aafee23, but wasn't properly filled. This mainly adjusts many locations, that expected strings instead of integers or boolean. add_pg_decoders is moved after setup of the StatementPool, because execute_and_clear could potentially make use of it.
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* Prefer `drop_table if_exists: true` over raw SQLRyuta Kamizono2015-02-181-2/+2
| | | | | Lowercase raw SQL has been replaced by 07b659c already. This commit replaces everything else of raw SQL.
* Remove Relation#bind_paramsSean Griffin2015-01-271-2/+6
| | | | | | | | `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.
* Should escape regexp wildcard character `.`Ryuta Kamizono2015-01-191-1/+1
| | | | | `.` is regexp meta character. It should be escape for `assert_match` correctly.
* pg tests, get rid of global schema `schema_1`.Yves Senn2014-12-021-1/+51
|
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* fix set_pk_sequence and add a test for it.Aaron Patterson2014-10-311-0/+8
|
* pg, correctly dump foreign keys targeting tables in a different schema.Yves Senn2014-09-171-0/+26
| | | | | | Closes #16907. [Matthew Draper & Yves Senn]
* pg, `reset_pk_sequence!` respects schemas. Closes #14719.Yves Senn2014-05-301-2/+11
|
* remove unused variable warningKuldeep Aggarwal2014-05-261-1/+1
| | | | `warning: assigned but unused variable - album`
* Fixed the inferred table name for HABTM within a schemaEric Chahin2014-05-201-0/+26
| | | | Fixes #14824.
* pg, re-introduce `PostgreSQL::Utils` to unify schema/table extraction.Yves Senn2014-05-191-15/+0
| | | | Partial revert of c0bfc3f412834ffe8327a15ae3a46602cc28e425
* PostgreSQLAdapter::Utils seems to be only used from a single spot - quite ↵kares2014-05-141-0/+15
| | | | redundant
* Prevent state leak in test.Guo Xiang Tan2014-04-031-17/+16
| | | | This will allow us to run the tests in random order.
* 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.
* Merge pull request #13688 from jbaudanza/psql-index-existsRafael Mendonça França2014-02-011-0/+12
|\ | | | | | | | | | | | | PostgreSQL implementation of SchemaStatements#index_name_exists? Conflicts: activerecord/CHANGELOG.md
| * psql implementation of #index_name_exists?Jonathan Baudanza2014-01-161-0/+12
| |
* | test to ensure bad prepared statements raise a StatementInvalid exceptionAaron Patterson2014-01-171-0/+6
|/
* Custom index type support with :using.doabit2013-03-241-5/+15
|
* #7914 get default value when type uses schema nameArturo Pie2012-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL adapter properly parses default values when using multiple schemas and domains. When using domains across schemas, PostgresSQL prefixes the type of the default value with the name of the schema where that type (or domain) is. For example, this query: ``` SELECT a.attname, d.adsrc FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = "defaults"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum; ``` could return something like "'<default_value>'::pg_catalog.text" or "(''<default_value>'::pg_catalog.text)::text" for the text columns with defaults. I modified the regexp used to parse this value so that it ignores anything between ':: and \b(?:character varying|bpchar|text), and it allows to have optional parens like in the above second example.
* Cleanup trailing whitespacesdfens2012-10-121-1/+1
|
* Adds #create/drop_schema on the PostgreSQL Adapter.Travis Jeffery2012-03-071-2/+37
|
* Add #schema_names to PostgreSQL Adapter.Travis Jeffery2012-03-071-0/+4
|
* Restored ability to identify ID and Sequence from tables relying on a ↵William Lawson2012-02-201-3/+7
| | | | nonmatching sequence default value for PK.
* Avoid postgres 9.X syntaxJon Leighton2011-12-031-1/+5
|
* Deprecate set_table_name in favour of self.table_name= or defining your own ↵Jon Leighton2011-11-291-5/+5
| | | | method.
* fixing tests on PGAaron Patterson2011-11-161-1/+1
|
* Merge pull request #3521 from ↵Aaron Patterson2011-11-061-0/+4
| | | | | | nulogy/fix_postgres_adapter_to_handle_spaces_between_schemas Fix postgres adapter to handle spaces between schemas
* AR changes to support creating ordered (asc, desc) indexesVlad Jebelev2011-11-041-4/+12
|
* reset prepared statement when schema changes imapact statement results. ↵Aaron Patterson2011-10-181-0/+8
| | | | fixes #3335
* refs #3232. Prepared statements and postgreSQL schemas.Juan M. Cuello2011-10-051-0/+19
| | | | | Add tests for prepared statements with multiple schemas in postgreSQL.
* Merge commit 'refs/pull/2909/head' of https://github.com/rails/rails into rawrAaron Patterson2011-09-071-0/+6
| | | | | | * https://github.com/rails/rails: Postgresql adapter: added current_schema check for table_exists? Postgresql adapter: added current_schema check for table_exists?
* Make #extract_schema_and_table an instance method in UtilsDaniel Schierbeck2011-07-091-15/+0
| | | | Also, move the utils test into its own test case.
* Refactor PostgreSQLAdapter a bitDaniel Schierbeck2011-07-081-2/+2
| | | | | Move the private method #extract_schema_and_table into a separate Utils module so that it can be tested without resorting to #send.
* Make PostgreSQL adapter view-compatiblePaul Gallagher2011-06-191-1/+0
| | | * amongst other things, allows meta_search to run against view-backed models
* make extract_schema_and_table a private methodPaul Gallagher2011-06-111-7/+7
|
* remove table quoting in primary_key methodPaul Gallagher2011-06-111-5/+17
| | | * add/cleanup tests
* apply private method indentation conventionPaul Gallagher2011-06-101-2/+2
| | | * tidy test code and fix my typo
* Improve PostgreSQL adapter schema-awarenessPaul Gallagher2011-06-101-2/+83
| | | | | | | * table_exists? scoped by schema search path unless schema is explicitly named. Added tests and doc to clarify the behaviour * extract_schema_and_table tests and implementation extended to cover all cases * primary_key does not ignore schema information * add current_schema and schema_exists? methods * more robust table referencing in insert_sql and sql_for_insert methods
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* index dump should not include full text indexes. Thanks Ken Mayer for the ↵Aaron Patterson2010-06-261-0/+4
| | | | | | original patch! [#4949 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* reorganizing adapter specific tests. [#4974 state:resolved]Aaron Patterson2010-06-251-0/+193
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>