Class: CreateSapeStorage

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/sape/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/sape/templates/migration.rb', line 2

def change
  create_table :sape_configs do |t|
    t.string :site_host
    t.string :name
    t.text :value, limit: 500
  end

  create_table :sape_links do |t|
    t.string :site_host
    t.string :page
    t.string :anchor
    t.string :url
    t.string :host
    t.text :raw_link, limit: 500
    t.string :link_type
  end
  add_index :sape_links, [:link_type, :page, :site_host]
  add_index :sape_configs, [:name, :site_host]
  add_index :sape_configs, :site_host
end