Sha256: bb6c7c426b9b652ad74e6e0bb3383fa181d023c2f7397462f706b52741b7e3af

Contents?: true

Size: 567 Bytes

Versions: 7

Compression:

Stored size: 567 Bytes

Contents

class AddAncestryToScriboContents < ActiveRecord::Migration[6.0]
  def change
    add_column :scribo_contents, :ancestry, :text
    add_index :scribo_contents, :ancestry, order: {ancestry: :text_pattern_ops}
    add_column :scribo_contents, :ancestry_depth, :integer,  default: 0
    add_index :scribo_contents, :ancestry_depth
    remove_column :scribo_contents, :children_count
    add_column :scribo_contents, :children_count, :integer,  default: 0
    add_index :scribo_contents, :children_count
    
    Scribo::Content.build_ancestry_from_parent_ids!
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scribo-1.0.44 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb
scribo-1.0.43 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb
scribo-1.0.42 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb
scribo-1.0.41 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb
scribo-1.0.40 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb
scribo-1.0.39 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb
scribo-1.0.38 db/migrate/20220919124119_add_ancestry_to_scribo_contents.rb