- B
- C
- D
- E
- H
- I
- J
- L
- M
- N
- O
- P
- S
- T
- U
- X
Instance Public methods
bigserial(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 46
bit(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 50
bit_varying(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 54
box(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 126
cidr(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 58
circle(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 138
citext(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 62
daterange(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 66
enum(*names, **options) Link
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 173 define_column_methods :bigserial, :bit, :bit_varying, :cidr, :citext, :daterange, :hstore, :inet, :interval, :int4range, :int8range, :jsonb, :ltree, :macaddr, :money, :numrange, :oid, :point, :line, :lseg, :box, :path, :polygon, :circle, :serial, :tsrange, :tstzrange, :tsvector, :uuid, :xml, :timestamptz, :enum
hstore(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 70
inet(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 74
int4range(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 82
int8range(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 86
interval(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 78
jsonb(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 90
line(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 118
lseg(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 122
ltree(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 94
macaddr(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 98
money(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 102
numrange(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 106
oid(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 110
path(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 130
point(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 114
polygon(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 134
primary_key(name, type = :primary_key, **options) Link
Defines the primary key field. Use of the native PostgreSQL UUID type is supported, and can be used by defining your tables as such:
create_table :stuffs, id: :uuid do |t|
t.string :content
t.timestamps
end
By default, this will use the gen_random_uuid()
function.
To use a UUID primary key without any defaults, set the :default
option to nil
:
create_table :stuffs, id: false do |t|
t.primary_key :id, :uuid, default: nil
t.uuid :foo_id
t.timestamps
end
You may also pass a custom stored procedure that returns a UUID or use a different UUID generation function from another library.
Note that setting the UUID primary key default value to nil
will require you to assure that you always provide a UUID value before saving a record (as primary keys cannot be nil
). This might be done via the SecureRandom.uuid
method and a before_save
callback, for instance.
serial(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 142
timestamptz(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 166
tsrange(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 146
tstzrange(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 150
tsvector(*names, **options) Link
Source: on GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 154