Needle.Migration.Indexable (Bonfire v1.0.0-social-rc.3.22)
View SourceHelpers for creating indexes on pointer fields in migrations.
Summary
Functions
Creates index for a pointer field on a table.
Bulk-creates indexes for pointer fields on a table.
Adds a pointer field and an index for it. Note: this uses alter table and can't be run in the same migration as the create table call for the same table.
Functions
Creates index for a pointer field on a table.
Bulk-creates indexes for pointer fields on a table.
Examples
create_indexes_for_pointers(:my_table, [:user_id, :thread_id])
create_indexes_for_pointers(:my_table, [user_id: [unique: true], thread_id: [unique: false]], [where: "deleted_at IS NULL"])
Adds a pointer field and an index for it. Note: this uses alter table and can't be run in the same migration as the create table call for the same table.
Example
create_pointer_with_index(:my_table, :thread_id, :strong, Needle.Pointer, unique: false)