2020-01-28 13:31:56 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Schema.define do
|
|
|
|
|
create_table :vector_models, force: true do |t|
|
|
|
|
|
t.string :name
|
|
|
|
|
t.string :value
|
|
|
|
|
t.tsvector :search_cache
|
|
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
|
|
|
|
add_index :vector_models, :search_cache, using: :gin
|
|
|
|
|
|
|
|
|
|
create_table :vector_with_custom_primary_key_models, id: false, force: true do |t|
|
|
|
|
|
t.uuid :uuid, null: false
|
|
|
|
|
t.string :name
|
|
|
|
|
t.string :value
|
|
|
|
|
t.tsvector :search_vector
|
|
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
|
|
|
|
add_index :vector_with_custom_primary_key_models, :uuid, using: :btree
|
|
|
|
|
add_index :vector_with_custom_primary_key_models, :search_vector, using: :gin
|
|
|
|
|
|
|
|
|
|
create_table :dynamic_models, force: true do |t|
|
|
|
|
|
t.string :name
|
|
|
|
|
t.string :value
|
|
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create_table :tags, force: true do |t|
|
|
|
|
|
t.string :value
|
2020-04-20 22:21:26 +02:00
|
|
|
t.string :custom_attribute
|
2020-01-28 13:31:56 +01:00
|
|
|
t.references :category, index: true
|
|
|
|
|
t.references :taggable, polymorphic: true, index: true
|
|
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create_table :categories, force: true do |t|
|
|
|
|
|
t.string :name
|
2020-04-20 22:21:26 +02:00
|
|
|
t.references :categoriable, polymorphic: true, index: true
|
2020-01-28 13:31:56 +01:00
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create_table :sections, force: true do |t|
|
|
|
|
|
t.references :tag
|
|
|
|
|
t.string :name
|
|
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
2020-04-29 07:22:03 +02:00
|
|
|
|
|
|
|
|
create_table :players, force: true do |t|
|
|
|
|
|
t.string :name
|
|
|
|
|
t.string :value
|
|
|
|
|
t.timestamps null: false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create_table :ptags, force: true do |t|
|
|
|
|
|
t.string :value
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create_table :taggings, force: true do |t|
|
|
|
|
|
t.belongs_to :player
|
|
|
|
|
t.belongs_to :ptag
|
|
|
|
|
end
|
2020-01-28 13:31:56 +01:00
|
|
|
end
|