Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Bump the minimum version of PostgreSQL to 9.3 | Yasuo Honda | 2018-11-25 | 1 | -4/+2 |
| | | | | | | | | | | | | | | | | | | | | https://www.postgresql.org/support/versioning/ - 9.1 EOLed on September 2016. - 9.2 EOLed on September 2017. 9.3 is also not supported since Nov 8, 2018. https://www.postgresql.org/about/news/1905/ I think it may be a little bit early to drop PostgreSQL 9.3 yet. * Deprecated `supports_ranges?` since no other databases support range data type * Add `supports_materialized_views?` to abstract adapter Materialized views itself is supported by other databases, other connection adapters may support them * Remove `with_manual_interventions` It was only necessary for PostgreSQL 9.1 or earlier * Drop CI against PostgreSQL 9.2 | ||||
* | Use squiggly heredoc to strip odd indentation in the executed SQL | Ryuta Kamizono | 2018-11-22 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` LOG: execute <unnamed>: SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool') LOG: execute <unnamed>: SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype FROM pg_type as t LEFT JOIN pg_range as r ON oid = rngtypid WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric') OR t.typtype IN ('r', 'e', 'd') OR t.typinput::varchar = 'array_in' OR t.typelem != 0 LOG: statement: SHOW TIME ZONE LOG: statement: SELECT 1 LOG: execute <unnamed>: SELECT COUNT(*) FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view AND c.relname = 'accounts' AND n.nspname = ANY (current_schemas(false)) ``` After: ``` LOG: execute <unnamed>: SELECT t.oid, t.typname FROM pg_type as t WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'bool') LOG: execute <unnamed>: SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype FROM pg_type as t LEFT JOIN pg_range as r ON oid = rngtypid WHERE t.typname IN ('int2', 'int4', 'int8', 'oid', 'float4', 'float8', 'text', 'varchar', 'char', 'name', 'bpchar', 'bool', 'bit', 'varbit', 'timestamptz', 'date', 'money', 'bytea', 'point', 'hstore', 'json', 'jsonb', 'cidr', 'inet', 'uuid', 'xml', 'tsvector', 'macaddr', 'citext', 'ltree', 'interval', 'path', 'line', 'polygon', 'circle', 'lseg', 'box', 'time', 'timestamp', 'numeric') OR t.typtype IN ('r', 'e', 'd') OR t.typinput::varchar = 'array_in' OR t.typelem != 0 LOG: statement: SHOW TIME ZONE LOG: statement: SELECT 1 LOG: execute <unnamed>: SELECT COUNT(*) FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','v','m') -- (r)elation/table, (v)iew, (m)aterialized view AND c.relname = 'accounts' AND n.nspname = ANY (current_schemas(false)) ``` | ||||
* | Use frozen-string-literal in ActiveRecord | Kir Shatrov | 2017-07-19 | 1 | -0/+2 |
| | |||||
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" | Matthew Draper | 2017-07-02 | 1 | -1/+0 |
| | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa. | ||||
* | Enforce frozen string in Rubocop | Kir Shatrov | 2017-07-01 | 1 | -0/+1 |
| | |||||
* | Use a query that's compatible with PostgreSQL 9.2 | Matthew Draper | 2017-04-12 | 1 | -1/+3 |
| | | | | | | Also, explicitly apply the order: generate_subscripts is unlikely to start returning values out of order, but we should still be clear about what we want. | ||||
* | Allow SQLServerAdapter to opt into a few tests. | Ken Collins | 2017-01-16 | 1 | -2/+2 |
| | |||||
* | `#tables` and `#table_exists?` and returns only tables and not views | Rafael Mendonça França | 2016-12-29 | 1 | -6/+4 |
| | |||||
* | Quote table name properly | Ryuta Kamizono | 2016-10-14 | 1 | -9/+15 |
| | | | | If does not quote table name properly, invalid SQL is generated. | ||||
* | Fix broken comments indentation caused by rubocop auto-correct [ci skip] | Ryuta Kamizono | 2016-09-14 | 1 | -1/+1 |
| | | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency. | ||||
* | Fix broken heredoc indentation caused by rubocop auto-correct | Ryuta Kamizono | 2016-09-03 | 1 | -6/+6 |
| | | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency. | ||||
* | Add three new rubocop rules | Rafael Mendonça França | 2016-08-16 | 1 | -2/+2 |
| | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository. | ||||
* | normalizes indentation and whitespace across the project | Xavier Noria | 2016-08-06 | 1 | -103/+103 |
| | |||||
* | Remove legacy mysql adapter | Abdelkader Boudih | 2015-12-17 | 1 | -2/+2 |
| | |||||
* | Deprecate `#table_exists?`, `#tables` and passing arguments to `#talbes` | yui-knk | 2015-11-09 | 1 | -7/+7 |
| | | | | | | | | | | Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`. | ||||
* | introduce `conn.data_source_exists?` and `conn.data_sources`. | Yves Senn | 2015-09-22 | 1 | -0/+6 |
| | | | | | | | | | | | | | | | | | These new methods are used from the Active Record model layer to determine which relations are viable to back a model. These new methods allow us to change `conn.tables` in the future to only return tables and no views. Same for `conn.table_exists?`. The goal is to provide the following introspection methods on the connection: * `tables` * `table_exists?` * `views` * `view_exists?` * `data_sources` (views + tables) * `data_source_exists?` (views + tables) | ||||
* | Do not dump a view as a table in sqlite3, mysql and mysql2 adapters | Ryuta Kamizono | 2015-09-13 | 1 | -0/+13 |
| | | | | | | Now in sqlite3, mysql and mysql2 adapters, SchemaDumper dump a view as a table. It is incorrect behavior. This change excludes a view in schema.rb. | ||||
* | Add `#views` and `#view_exists?` methods on connection adapters | Ryuta Kamizono | 2015-09-13 | 1 | -0/+18 |
| | |||||
* | Add view tests for MySQL | yui-knk | 2015-09-08 | 1 | -0/+66 |
| | | | | | | | | | Basically view tests for MySQL are same with `test/cases/adapters/postgresql/view_test.rb`. So move `test/cases/adapters/postgresql/view_test.rb` to `test/cases/view_test.rb` and make them only run if `current_adapter` supports writable view. | ||||
* | Resolve enums in test fixtures | George Claghorn | 2015-05-27 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | Currently, values for columns backing Active Record enums must be specified as integers in test fixtures: awdr: title: "Agile Web Development with Rails" status: 2 rfr: title: "Ruby for Rails" status: <%= Book.statuses[:proposed] %> This is potentially confusing, since enum values are typically specified as symbols or strings in application code. To resolve the confusion, this change permits the use of symbols or strings to specify enum values: awdr: status: :published It is compatible with fixtures that specify enum values as integers. | ||||
* | reuse view test-cases for pg materialized view tests. | Yves Senn | 2014-09-11 | 1 | -9/+27 |
| | |||||
* | Oracle does not support `IF EXISTS` for `DROP VIEW`. | Yves Senn | 2014-09-09 | 1 | -2/+2 |
| | | | | /cc @yahonda | ||||
* | models backed by views don't assume "id" columns are the primary key. | Yves Senn | 2014-09-09 | 1 | -0/+11 |
| | | | | | | | | Closes #10247. The same goes for tables with an "id" column but without primary key constraint. Reading from the view works without configuration. If you have an updateable view you need to use `self.primary_key = ''`. | ||||
* | add test-cases for primary-key-less-views. Closes #16555. | Yves Senn | 2014-09-09 | 1 | -0/+43 |
| | |||||
* | Merge pull request #14056 from girishso/14041 | Yves Senn | 2014-09-09 | 1 | -1/+0 |
| | | | | | | | SQLite3Adapter now checks for views in table_exists? fixes: 14041 Conflicts: activerecord/CHANGELOG.md | ||||
* | introduce `connection.supports_views?` and basic view tests. | Yves Senn | 2014-09-09 | 1 | -0/+42 |
`AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on in adapter subclasses. Currently the flag only controls test execution. /cc @yahonda |