aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate/1_create_banners_banners.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/1_create_banners_banners.rb')
-rw-r--r--db/migrate/1_create_banners_banners.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/db/migrate/1_create_banners_banners.rb b/db/migrate/1_create_banners_banners.rb
new file mode 100644
index 0000000..680fd7b
--- /dev/null
+++ b/db/migrate/1_create_banners_banners.rb
@@ -0,0 +1,34 @@
+class CreateBannersBanners < ActiveRecord::Migration
+
+ def up
+ create_table :refinery_banners do |t|
+ t.string :name
+ t.string :title
+ t.string :description
+ t.integer :image_id
+ t.string :url
+ t.boolean :is_active
+ t.date :start_date
+ t.date :expiry_date
+ t.integer :position
+ t.integer :position
+
+ t.timestamps
+ end
+
+ end
+
+ def down
+ if defined?(::Refinery::UserPlugin)
+ ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-banners"})
+ end
+
+ if defined?(::Refinery::Page)
+ ::Refinery::Page.delete_all({:link_url => "/banners/banners"})
+ end
+
+ drop_table :refinery_banners
+
+ end
+
+end