Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use squiggly heredoc to strip odd indentation in the executed SQL | Ryuta Kamizono | 2018-11-22 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 assert_predicate and assert_not_predicate | Daniel Colson | 2018-01-25 | 1 | -4/+4 |
| | |||||
* | `supports_extensions?` return always true since PostgreSQL 9.1 | Yasuo Honda | 2017-10-24 | 1 | -98/+92 |
| | | | | | | | | since the minimum version of PostgreSQL currently Rails supports is 9.1, there is no need to handle if `supports_extensions?` Refer https://www.postgresql.org/docs/9.1/static/sql-createextension.html "CREATE EXTENSION" | ||||
* | Add an extra assertion to ensure dumping schema default as expected | Ryuta Kamizono | 2017-09-08 | 1 | -1/+4 |
| | |||||
* | Fix `quote_default_expression` for UUID with array default | Ryuta Kamizono | 2017-09-08 | 1 | -0/+10 |
| | | | | Fixes #30539. | ||||
* | Use frozen-string-literal in ActiveRecord | Kir Shatrov | 2017-07-19 | 1 | -0/+2 |
| | |||||
* | Don't allow uuids with orphan curly braces | pdebelak | 2017-07-07 | 1 | -1/+3 |
| | | | | | | | | The uuid validation regex was allowing uuids to have a single leading curly brace or single trailing curly brace. Saving with such a uuid would cause Postgres to generate an exception even though the record seemed valid. With this change, the regex requires both a leading *and* a trailing curly brace or neither to be valid. | ||||
* | 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 |
| | |||||
* | Allow `uuid_test.rb` to be loaded on all adapters | Eugene Kenny | 2017-06-14 | 1 | -1/+2 |
| | | | | | | | | | Running `bin/test` from the activerecord directory produces this error: test/cases/adapters/postgresql/uuid_test.rb:43:in `<class:PostgresqlUUIDTest>': undefined method `supports_pgcrypto_uuid?' for #<ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x007fc405e72a68> (NoMethodError) The test only actually runs on the PostgreSQL adapter; we can avoid triggering the error on other adapters with this `respond_to?` guard. | ||||
* | Remove assert_nothing_raised, as test is already testing the required concerns | Prathamesh Sonpatki | 2017-06-03 | 1 | -3/+3 |
| | |||||
* | Fix UUID column with `null: true` and `default: nil` | Ryuta Kamizono | 2017-05-30 | 1 | -0/+10 |
| | | | | | | | `quote_default_expression` can be passed nil value when `null: true` and `default: nil`. This addressed in that case. Fixes #29222. | ||||
* | Use a query that's compatible with PostgreSQL 9.2 | Matthew Draper | 2017-04-12 | 1 | -3/+7 |
| | | | | | | 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. | ||||
* | Add `Style/EmptyLinesAroundMethodBody` in `.rubocop.yml` and remove extra ↵ | Ryuta Kamizono | 2017-02-12 | 1 | -1/+0 |
| | | | | empty lines | ||||
* | Fix UUID primary key with default nil in legacy migration | Ryuta Kamizono | 2017-01-09 | 1 | -0/+19 |
| | | | | | | UUID primary key with no default value feature (#10404, #18206) was lost in legacy migration caused by #25395 got merged. Restore the feature again in legacy migration. | ||||
* | Should test uuid legacy migration without `supports_pgcrypto_uuid?` | Ryuta Kamizono | 2017-01-09 | 1 | -19/+17 |
| | |||||
* | "Use assert_nil if expecting nil from ...:in `...'. This will fail in MT6." | Akira Matsuda | 2016-12-25 | 1 | -2/+2 |
| | |||||
* | "Use assert_nil if expecting nil. This will fail in minitest 6." | Akira Matsuda | 2016-12-25 | 1 | -1/+1 |
| | |||||
* | Should test `test_change_column_default` in `PostgresqlUUIDTest` | Ryuta Kamizono | 2016-11-25 | 1 | -13/+13 |
| | | | | Follow up to #25395. | ||||
* | Merge pull request #27171 from kamipo/suppress_migration_message | Matthew Draper | 2016-11-25 | 1 | -0/+4 |
|\ | | | | | Suppress migration message in the test | ||||
| * | Suppress migration message in the test | Ryuta Kamizono | 2016-11-25 | 1 | -0/+4 |
| | | |||||
* | | Remove blank else block | Ryuta Kamizono | 2016-11-25 | 1 | -1/+0 |
|/ | |||||
* | For `PostgreSQL >= 9.4` use `gen_random_uuid()` | Yaw Boakye | 2016-11-22 | 1 | -14/+59 |
| | | | | | | | | | | Since 9.4, PostgreSQL recommends using `pgcrypto`'s `gen_random_uuid()` to generate version 4 UUIDs instead of the functions in the `uuid-ossp` extension. These changes uses the appropriate UUID function depending on the underlying PostgreSQL server's version, while maintaining `uuid_generate_v4()` in older migrations. | ||||
* | Fix CI failure caused by df84e9867219e9311aef6f4efd5dd9ec675bee5c | Ryuta Kamizono | 2016-08-23 | 1 | -2/+2 |
| | |||||
* | applies remaining conventions across the project | Xavier Noria | 2016-08-06 | 1 | -1/+0 |
| | |||||
* | normalizes indentation and whitespace across the project | Xavier Noria | 2016-08-06 | 1 | -2/+2 |
| | |||||
* | applies new string literal convention in activerecord/test | Xavier Noria | 2016-08-06 | 1 | -40/+40 |
| | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default. | ||||
* | Add expression support on the schema default | Ryuta Kamizono | 2016-01-13 | 1 | -4/+4 |
| | | | | | | | | Example: create_table :posts do |t| t.datetime :published_at, default: -> { 'NOW()' } end | ||||
* | Remove unnecessary enable,disable_extension on tests | Fumiaki MATSUSHIMA | 2016-01-02 | 1 | -9/+0 |
| | | | | | | | uuid-ossp extension is alreadly enabled on test schema. And `disable_extension!('uuid-ossp', connection)` can be a cause of test failure. `ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: function uuid_generate_v1() does not exist` will happen depending on the execution order. | ||||
* | Ensure uuid-ossp extension is present before we rely on it | Matthew Draper | 2015-12-15 | 1 | -0/+2 |
| | |||||
* | make it possible to run AR tests with bin/test | Yves Senn | 2015-06-11 | 1 | -4/+4 |
| | |||||
* | Remove duplicated test | Ryuta Kamizono | 2015-03-04 | 1 | -20/+0 |
| | | | | | `PostgresqlLargeKeysTest` is duplicated `PrimaryKeyBigSerialTest` in `primary_keys_test.rb`. | ||||
* | prefer `drop_table if_exists: true` over raw SQL. | Yves Senn | 2015-02-18 | 1 | -1/+1 |
| | | | | | | | /cc @yahonda This makes it easier for third party adapters to run our tests, even if that database does not support IF EXISTS. | ||||
* | rm `Type#number?` | Sean Griffin | 2015-02-07 | 1 | -1/+0 |
| | | | | | This predicate is only used in `query_attribute`, and is relatively easy to remove without adding a bunch of is a checks. | ||||
* | Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵ | Vipul A M | 2015-02-03 | 1 | -1/+0 |
| | | | | onwards. | ||||
* | Remove most type related predicates from `Column` | Sean Griffin | 2015-01-30 | 1 | -2/+4 |
| | | | | | | Remaining are `limit`, `precision`, `scale`, and `type` (the symbol version). These will remain on the column, since they mirror the options to the `column` method in the schema definition DSL | ||||
* | Should escape regexp wildcard character `.` | Ryuta Kamizono | 2015-01-19 | 1 | -1/+1 |
| | | | | | `.` is regexp meta character. It should be escape for `assert_match` correctly. | ||||
* | Prefer `array?` rather than `array` | Ryuta Kamizono | 2015-01-04 | 1 | -1/+1 |
| | | | | | | Slightly refactoring `PostgreSQLColumn`. `array` should be readonly. `default_function` should be initialized by `super`. `sql_type` has been removed `[]`. Since we already choose to remove it we should not change. | ||||
* | Correctly ignore `case_sensitive` for UUID uniqueness validation | Sean Griffin | 2014-12-26 | 1 | -0/+17 |
| | | | | | | | | I think we should deprecate this behavior and just error if you tell us to do a case insensitive comparison for types which are not case sensitive. Partially reverts 35592307 Fixes #18195 | ||||
* | Dump the default `nil` for PostgreSQL UUID primary key. | Ryuta Kamizono | 2014-12-26 | 1 | -0/+6 |
| | |||||
* | `force: :cascade` to recreate tables referenced by foreign-keys. | Yves Senn | 2014-12-19 | 1 | -1/+1 |
| | |||||
* | Relax the UUID regex | Godfrey Chan | 2014-12-18 | 1 | -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 | ||||
* | tests, move schema shorthand assertions into pg specific tests. | Yves Senn | 2014-12-02 | 1 | -0/+6 |
| | |||||
* | tests, remove unneeded requires. | Yves Senn | 2014-11-06 | 1 | -3/+0 |
| | |||||
* | tests, use SchemaDumpingHelper to dump a specific table. | Yves Senn | 2014-11-06 | 1 | -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. | ||||
* | add bigserial pk support | Aaron Patterson | 2014-10-29 | 1 | -0/+20 |
| | |||||
* | Added enable_extension! to helper | Abdelkader Boudih | 2014-09-05 | 1 | -5/+6 |
| | |||||
* | adding the exception RecordNotFound to UUID find | JoseLuis Torres | 2014-08-21 | 1 | -0/+14 |
| | |||||
* | Allow to specify a type for foreign key column in migrations | Andrey Novikov | 2014-07-22 | 1 | -1/+1 |
| | | | | [Andrey Novikov & Łukasz Sarnacki] | ||||
* | Treat invalid uuid as nil | Abdelkader Boudih | 2014-07-14 | 1 | -0/+37 |
| |