diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20140216165731_create_banners_banners.refinery_banners.rb | 35 | ||||
-rw-r--r-- | db/migrate/20140216165732_create_banners_banners_pages.refinery_banners.rb | 16 | ||||
-rw-r--r-- | db/schema.rb | 24 | ||||
-rw-r--r-- | db/seeds.rb | 2 |
4 files changed, 76 insertions, 1 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
diff --git a/db/schema.rb b/db/schema.rb index 7ef62f9..94a7af9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,29 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20131223174901) do +ActiveRecord::Schema.define(:version => 20140216165732) do + + create_table "refinery_banners", :force => true 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.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "refinery_banners_pages", :id => false, :force => true do |t| + t.integer "page_id" + t.integer "banner_id" + end + + add_index "refinery_banners_pages", ["banner_id"], :name => "index_refinery_banners_pages_on_banner_id" + add_index "refinery_banners_pages", ["page_id"], :name => "index_refinery_banners_pages_on_page_id" create_table "refinery_blog_categories", :force => true do |t| t.string "title" diff --git a/db/seeds.rb b/db/seeds.rb index 8364d2f..7391f95 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -17,3 +17,5 @@ Refinery::Inquiries::Engine.load_seed # Added by Refinery CMS Search engine Refinery::Search::Engine.load_seed + +Refinery::Banners::Engine.load_seed |