Sha256: adbaf9b4611d6c3cb1f30263d477394335dc428f41efe2b54327941620668195
Contents?: true
Size: 856 Bytes
Versions: 17
Compression:
Stored size: 856 Bytes
Contents
class CreateProclaimCommentHierarchies < ActiveRecord::Migration def change create_table :proclaim_comment_hierarchies, :id => false do |t| # ID of the parent/grandparent/great-grandparent/etc. comments t.integer :ancestor_id, null: false # ID of the target comment t.integer :descendant_id, null: false # Number of generations between the ancestor and the descendant. # Parent/child = 1, for example. t.integer :generations, null: false end # For "all progeny of…" and leaf selects: add_index :proclaim_comment_hierarchies, [:ancestor_id, :descendant_id, :generations], :unique => true, :name => "comment_anc_desc_udx" # For "all ancestors of…" selects, add_index :proclaim_comment_hierarchies, [:descendant_id], :name => "comment_desc_idx" end end
Version data entries
17 entries across 17 versions & 1 rubygems