Module: RocketCMS::Migration

Extended by:
Migration
Included in:
Migration
Defined in:
lib/rocket_cms/migration.rb

Instance Method Summary collapse

Instance Method Details

#map_fields(t) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/rocket_cms/migration.rb', line 28

def map_fields(t)
  t.text :address
  t.text :map_address
  t.text :map_hint
  t.float :latitude
  t.float :longitude
  t.float :lat
  t.float :lon
end

#seo_fields(t) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rocket_cms/migration.rb', line 5

def seo_fields(t)
  if RocketCMS.config.localize
    t.column :h1_translations, 'hstore', default: {}
    t.column :title_translations, 'hstore', default: {}
    t.column :keywords_translations, 'hstore', default: {}
    t.column :description_translations, 'hstore', default: {}
    t.column :og_title_translations, 'hstore', default: {}
  else
    t.string :h1
    t.string :title
    t.text :keywords
    t.text :description
    t.string :og_title
  end
  t.string :robots

  if RocketCMS.shrine?
    t.jsonb :og_image_data
  elsif RocketCMS.paperclip?
    t.attachment :og_image
  end
end