aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20140216165731_create_banners_banners.refinery_banners.rb35
-rw-r--r--db/migrate/20140216165732_create_banners_banners_pages.refinery_banners.rb16
2 files changed, 51 insertions, 0 deletions
diff --git a/db/migrate/20140216165731_create_banners_banners.refinery_banners.rb b/db/migrate/20140216165731_create_banners_banners.refinery_banners.rb
new file mode 100644
index 0000000..d2d1968
--- /dev/null
+++ b/db/migrate/20140216165731_create_banners_banners.refinery_banners.rb
@@ -0,0 +1,35 @@
+# This migration comes from refinery_banners (originally 1)
+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
diff --git a/db/migrate/20140216165732_create_banners_banners_pages.refinery_banners.rb b/db/migrate/20140216165732_create_banners_banners_pages.refinery_banners.rb
new file mode 100644
index 0000000..175e593
--- /dev/null
+++ b/db/migrate/20140216165732_create_banners_banners_pages.refinery_banners.rb
@@ -0,0 +1,16 @@
+# This migration comes from refinery_banners (originally 2)
+class CreateBannersBannersPages < ActiveRecord::Migration
+ def self.up
+ create_table :refinery_banners_pages, :id => false do |t|
+ t.integer :page_id
+ t.integer :banner_id
+ end
+
+ add_index :refinery_banners_pages, :page_id
+ add_index :refinery_banners_pages, :banner_id
+ end
+
+ def self.down
+ drop_table :refinery_banners_pages
+ end
+end