Sha256: bcbf63fb2d187860c72ffe2a1f6e3797c99342fbd1d733a8ed96e271aad1b583
Contents?: true
Size: 742 Bytes
Versions: 16
Compression:
Stored size: 742 Bytes
Contents
class MonarchyCreateHierarchies < ActiveRecord::Migration def change create_table :monarchy_hierarchies do |t| t.integer :parent_id t.integer :resource_id, null: false t.string :resource_type, null: false t.timestamps null: false end create_table :monarchy_hierarchy_hierarchies, id: false do |t| t.integer :ancestor_id, null: false t.integer :descendant_id, null: false t.integer :generations, null: false end add_index :monarchy_hierarchy_hierarchies, [:ancestor_id, :descendant_id, :generations], unique: true, name: 'hierarchy_anc_desc_idx' add_index :monarchy_hierarchy_hierarchies, [:descendant_id], name: 'hierarchy_desc_idx' end end
Version data entries
16 entries across 16 versions & 1 rubygems