aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/uuid_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Should test `test_change_column_default` in `PostgresqlUUIDTest`Ryuta Kamizono2016-11-251-13/+13
| | | | Follow up to #25395.
* Merge pull request #27171 from kamipo/suppress_migration_messageMatthew Draper2016-11-251-0/+4
|\ | | | | Suppress migration message in the test
| * Suppress migration message in the testRyuta Kamizono2016-11-251-0/+4
| |
* | Remove blank else blockRyuta Kamizono2016-11-251-1/+0
|/
* For `PostgreSQL >= 9.4` use `gen_random_uuid()`Yaw Boakye2016-11-221-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 df84e9867219e9311aef6f4efd5dd9ec675bee5cRyuta Kamizono2016-08-231-2/+2
|
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-2/+2
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-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 defaultRyuta Kamizono2016-01-131-4/+4
| | | | | | | | Example: create_table :posts do |t| t.datetime :published_at, default: -> { 'NOW()' } end
* Remove unnecessary enable,disable_extension on testsFumiaki MATSUSHIMA2016-01-021-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 itMatthew Draper2015-12-151-0/+2
|
* make it possible to run AR tests with bin/testYves Senn2015-06-111-4/+4
|
* Remove duplicated testRyuta Kamizono2015-03-041-20/+0
| | | | | `PostgresqlLargeKeysTest` is duplicated `PrimaryKeyBigSerialTest` in `primary_keys_test.rb`.
* prefer `drop_table if_exists: true` over raw SQL.Yves Senn2015-02-181-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 Griffin2015-02-071-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 M2015-02-031-1/+0
| | | | onwards.
* Remove most type related predicates from `Column`Sean Griffin2015-01-301-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 Kamizono2015-01-191-1/+1
| | | | | `.` is regexp meta character. It should be escape for `assert_match` correctly.
* Prefer `array?` rather than `array`Ryuta Kamizono2015-01-041-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 validationSean Griffin2014-12-261-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 Kamizono2014-12-261-0/+6
|
* `force: :cascade` to recreate tables referenced by foreign-keys.Yves Senn2014-12-191-1/+1
|
* Relax the UUID regexGodfrey Chan2014-12-181-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 Senn2014-12-021-0/+6
|
* tests, remove unneeded requires.Yves Senn2014-11-061-3/+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.
* add bigserial pk supportAaron Patterson2014-10-291-0/+20
|
* Added enable_extension! to helperAbdelkader Boudih2014-09-051-5/+6
|
* adding the exception RecordNotFound to UUID findJoseLuis Torres2014-08-211-0/+14
|
* 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.
* Remove the `text?` predicate from the type objectsSean Griffin2014-07-061-1/+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.
* [Postgresql tests] remove duplicate helperAbdelkader Boudih2014-06-281-12/+3
|
* test, use `columns_hash[]` in place of `columns.find {}`.Yves Senn2014-05-121-2/+2
|
* test, reset changed state in PG's uuid tests.Yves Senn2014-05-081-2/+4
| | | | | | | | | | | | | This resulted in some unrelated errors on Traivs: 1) Error: PostgresqlUUIDTest#test_treat_blank_uuid_as_nil: ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column "thingy" of relation "uuid_data_type" does not exist LINE 1: INSERT INTO "uuid_data_type" ("thingy") VALUES ($1) RETURNIN... ^ : INSERT INTO "uuid_data_type" ("thingy") VALUES ($1) RETURNING "id" /cc @zuhao
* Changed change_column in PG schema_statements.rb to make sure that the ↵Eric Chahin2014-04-151-0/+13
| | | | uuid_generate function was not being quoted.
* Treat blank UUID values as nilDmitry Lavrov2014-04-031-0/+5
|
* PostgreSQL, test cases to lock the current column types.Yves Senn2014-03-281-1/+7
|
* extract common code in `uuid_test.rb`.Yves Senn2014-02-261-60/+57
|
* move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`.Yves Senn2014-02-261-0/+35
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-34/+46
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* Dump the default function when the primary key is uuidRafael Mendonça França2013-10-141-2/+2
| | | | Fixes #12489
* Merge pull request #11382 from kennyj/fix_10751-2Rafael Mendonça França2013-09-221-0/+1
|\ | | | | | | | | | | | | Dump UUID default functions to schema.rb [2nd version]. Fixes #10751. Conflicts: activerecord/CHANGELOG.md
| * Migration dump UUID default functions to schema.rb. Fixes #10751.kennyj2013-07-101-0/+1
| |
* | Fixed a bug in when using has_many association with :inverse_of option and ↵kennyj2013-05-081-0/+40
|/ | | | UUID primary key.
* fix to remove warning on postgres adapter test.Akshay Khole2013-05-051-1/+1
| | | | | Warning was: "/vagrant/rails/activerecord/test/cases/adapters/postgresql/uuid_test.rb:63: warning: ambiguous first argument; put parentheses or even spaces"
* Make SchemaDumper emit "id: :uuid" when appropriate. Fixes #10451.Brian Buchanan2013-05-031-0/+12
|
* Improve docs for postgresql with uuid primary keys [ci skip]Carlos Antonio da Silva2013-05-011-1/+0
| | | | Introduced in 09ac1776abc0d3482f491f2d49f47bcb3d9a4ad7.