aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/extensions/gallery_links/db/migrate/1_create_gallery_links_gallery_links.rb
blob: b55d337db029f04220c19c4574f221bad23759b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class CreateGalleryLinksGalleryLinks < ActiveRecord::Migration

  def up
    create_table :refinery_gallery_links do |t|
      t.string :title
      t.string :url
      t.string :photographer
      t.text :description
      t.integer :image_id
      t.integer :position

      t.timestamps
    end

  end

  def down
    if defined?(::Refinery::UserPlugin)
      ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-gallery_links"})
    end

    if defined?(::Refinery::Page)
      ::Refinery::Page.delete_all({:link_url => "/gallery_links/gallery_links"})
    end

    drop_table :refinery_gallery_links

  end

end