| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Actually SQLite3 doesn't have JSON storage class (so it is stored as a
TEXT like Date and Time). But emulating JSON types is convinient for
making database agnostic migrations.
|
|
|
|
| |
Add validate_constraint and update naming
|
| |
|
|
|
|
|
|
| |
Currently the normalization only exists in `primary_key` shorthand. It
should be moved to `new_column_definition` to also affect to
`add_column` with primary key.
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
| |
Closes #27980
|
|
|
|
| |
Closes #27979
|
|
|
|
|
|
| |
Column options are passed as an hash args then used as `options` hash in
`add_column_options!`. Converting args to attributes is inconvinient for
using options as an hash.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PR #27384 changed migration compatibility behaviour.
```ruby
class CreateMasterData < ActiveRecord::Migration[5.0]
def change
create_table :master_data, id: :integer do |t|
t.string :name
end
end
end
```
Previously this migration created non-autoincremental primary key
expected. But after the PR, the primary key changed to autoincremental,
it is unexpected.
This change restores the behaviour of the compatibility layer.
|
|
|
|
|
|
| |
* Don't force PKs on tables that have explicitly opted out
* All integer-like PKs are autoincrement unless they have an explicit
default
|
|
|
|
| |
Follow up to #27272.
|
|
|
|
|
|
| |
Using `:auto_increment` option for abstracting the DB-specific auto
incremental types. It is worth to ease to implement the compatibility
layer.
|
|
|
|
|
|
|
| |
- Mentioned clearly that for PostgreSQL < 9.4, you need to pass the
default option with "uuid_generate_v4()"
- Also updated PostgreSQL Active Record guide with this change.
- https://github.com/rails/rails/pull/25395#r66877078
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Because call the `column` method and set the `options[:primary_key]` is
handled at `super`, here need only treat the `options[:default]`.
|
|
|
|
|
| |
TableDefinition#column is not called from `add_column`.
Use TableDefinition#new_column_definition for column option handling.
|
|
|
|
| |
[Philippe Creux, Chris Teague]
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
This mirrors the layout of abstract adapter and puts the definitions
inside the `PostgreSQL` namespace (no longer under the adapter namespace).
/cc @kares
|