aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2013-06-11 21:50:49 +0200
committerHarald Eilertsen <haraldei@anduin.net>2013-06-11 21:50:49 +0200
commitadaed6db74ee721e6a987454addb6b2e4c13b1e5 (patch)
tree91be8477ed49b3c0309f2b3e2c32e7e841e7b083 /db/migrate
parentb86ce4923c74970e30d5393696d1ff7113fe7b0b (diff)
downloadhmnoweb-adaed6db74ee721e6a987454addb6b2e4c13b1e5.tar.gz
hmnoweb-adaed6db74ee721e6a987454addb6b2e4c13b1e5.tar.bz2
hmnoweb-adaed6db74ee721e6a987454addb6b2e4c13b1e5.zip
Configure for Heavymetal.no
Enable all the standard engines: - blog - inquiries - search - page-images - videos
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20130611193502_create_blog_structure.refinery_blog.rb53
-rw-r--r--db/migrate/20130611193503_add_user_id_to_blog_posts.refinery_blog.rb8
-rw-r--r--db/migrate/20130611193504_acts_as_taggable_on_migration.refinery_blog.rb29
-rw-r--r--db/migrate/20130611193505_add_cached_slugs.refinery_blog.rb7
-rw-r--r--db/migrate/20130611193506_add_custom_url_field_to_blog_posts.refinery_blog.rb6
-rw-r--r--db/migrate/20130611193507_add_custom_teaser_field_to_blog_posts.refinery_blog.rb7
-rw-r--r--db/migrate/20130611193508_add_primary_key_to_categorizations.refinery_blog.rb15
-rw-r--r--db/migrate/20130611193509_add_source_url_to_blog_posts.refinery_blog.rb8
-rw-r--r--db/migrate/20130611193510_add_access_count_to_posts.refinery_blog.rb9
-rw-r--r--db/migrate/20130611193511_add_slug_to_posts_and_categories.refinery_blog.rb10
-rw-r--r--db/migrate/20130611193512_create_refinerycms_settings_schema.refinery_settings.rb17
-rw-r--r--db/migrate/20130611193519_create_inquiries.refinery_inquiries.rb25
-rw-r--r--db/migrate/20130611193536_create_search_page.refinery_search.rb17
-rw-r--r--db/migrate/20130611193607_create_page_images.refinery_page_images.rb13
-rw-r--r--db/migrate/20130611193608_add_caption_to_image_pages.refinery_page_images.rb6
-rw-r--r--db/migrate/20130611193609_translate_page_image_captions.refinery_page_images.rb23
-rw-r--r--db/migrate/20130611193610_change_page_to_polymorphic.refinery_page_images.rb6
-rw-r--r--db/migrate/20130611193620_create_videos_videos.refinery_videos.rb30
-rw-r--r--db/migrate/20130611193621_create_video_file.refinery_videos.rb26
19 files changed, 315 insertions, 0 deletions
diff --git a/db/migrate/20130611193502_create_blog_structure.refinery_blog.rb b/db/migrate/20130611193502_create_blog_structure.refinery_blog.rb
new file mode 100644
index 0000000..c476909
--- /dev/null
+++ b/db/migrate/20130611193502_create_blog_structure.refinery_blog.rb
@@ -0,0 +1,53 @@
+# This migration comes from refinery_blog (originally 20110803223522)
+class CreateBlogStructure < ActiveRecord::Migration
+
+ def up
+ create_table Refinery::Blog::Post.table_name, :id => true do |t|
+ t.string :title
+ t.text :body
+ t.boolean :draft
+ t.datetime :published_at
+ t.timestamps
+ end
+
+ add_index Refinery::Blog::Post.table_name, :id
+
+ create_table Refinery::Blog::Comment.table_name, :id => true do |t|
+ t.integer :blog_post_id
+ t.boolean :spam
+ t.string :name
+ t.string :email
+ t.text :body
+ t.string :state
+ t.timestamps
+ end
+
+ add_index Refinery::Blog::Comment.table_name, :id
+
+ create_table Refinery::Blog::Category.table_name, :id => true do |t|
+ t.string :title
+ t.timestamps
+ end
+
+ add_index Refinery::Blog::Category.table_name, :id
+
+ create_table Refinery::Categorization.table_name, :id => true do |t|
+ t.integer :blog_category_id
+ t.integer :blog_post_id
+ end
+
+ add_index Refinery::Categorization.table_name, [:blog_category_id, :blog_post_id], :name => 'index_blog_categories_blog_posts_on_bc_and_bp'
+ end
+
+ def down
+ Refinery::UserPlugin.destroy_all({:name => "refinerycms_blog"})
+
+ Refinery::Page.delete_all({:link_url => "/blog"})
+
+ drop_table Refinery::Blog::Post.table_name
+ drop_table Refinery::Blog::Comment.table_name
+ drop_table Refinery::Category.table_name
+ drop_table Refinery::Categorization.table_name
+ end
+
+end
diff --git a/db/migrate/20130611193503_add_user_id_to_blog_posts.refinery_blog.rb b/db/migrate/20130611193503_add_user_id_to_blog_posts.refinery_blog.rb
new file mode 100644
index 0000000..80e1795
--- /dev/null
+++ b/db/migrate/20130611193503_add_user_id_to_blog_posts.refinery_blog.rb
@@ -0,0 +1,8 @@
+# This migration comes from refinery_blog (originally 20110803223523)
+class AddUserIdToBlogPosts < ActiveRecord::Migration
+
+ def change
+ add_column Refinery::Blog::Post.table_name, :user_id, :integer
+ end
+
+end \ No newline at end of file
diff --git a/db/migrate/20130611193504_acts_as_taggable_on_migration.refinery_blog.rb b/db/migrate/20130611193504_acts_as_taggable_on_migration.refinery_blog.rb
new file mode 100644
index 0000000..be9b88c
--- /dev/null
+++ b/db/migrate/20130611193504_acts_as_taggable_on_migration.refinery_blog.rb
@@ -0,0 +1,29 @@
+# This migration comes from refinery_blog (originally 20110803223524)
+class ActsAsTaggableOnMigration < ActiveRecord::Migration
+ def up
+ create_table :tags do |t|
+ t.string :name
+ end
+
+ create_table :taggings do |t|
+ t.references :tag
+
+ # You should make sure that the column created is
+ # long enough to store the required class names.
+ t.references :taggable, :polymorphic => true
+ t.references :tagger, :polymorphic => true
+
+ t.string :context
+
+ t.datetime :created_at
+ end
+
+ add_index :taggings, :tag_id
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
+
+ def down
+ drop_table :taggings
+ drop_table :tags
+ end
+end
diff --git a/db/migrate/20130611193505_add_cached_slugs.refinery_blog.rb b/db/migrate/20130611193505_add_cached_slugs.refinery_blog.rb
new file mode 100644
index 0000000..64a4c78
--- /dev/null
+++ b/db/migrate/20130611193505_add_cached_slugs.refinery_blog.rb
@@ -0,0 +1,7 @@
+# This migration comes from refinery_blog (originally 20110803223526)
+class AddCachedSlugs < ActiveRecord::Migration
+ def change
+ add_column Refinery::Blog::Category.table_name, :cached_slug, :string
+ add_column Refinery::Blog::Post.table_name, :cached_slug, :string
+ end
+end
diff --git a/db/migrate/20130611193506_add_custom_url_field_to_blog_posts.refinery_blog.rb b/db/migrate/20130611193506_add_custom_url_field_to_blog_posts.refinery_blog.rb
new file mode 100644
index 0000000..2d6b369
--- /dev/null
+++ b/db/migrate/20130611193506_add_custom_url_field_to_blog_posts.refinery_blog.rb
@@ -0,0 +1,6 @@
+# This migration comes from refinery_blog (originally 20110803223527)
+class AddCustomUrlFieldToBlogPosts < ActiveRecord::Migration
+ def change
+ add_column Refinery::Blog::Post.table_name, :custom_url, :string
+ end
+end
diff --git a/db/migrate/20130611193507_add_custom_teaser_field_to_blog_posts.refinery_blog.rb b/db/migrate/20130611193507_add_custom_teaser_field_to_blog_posts.refinery_blog.rb
new file mode 100644
index 0000000..e818e76
--- /dev/null
+++ b/db/migrate/20130611193507_add_custom_teaser_field_to_blog_posts.refinery_blog.rb
@@ -0,0 +1,7 @@
+# This migration comes from refinery_blog (originally 20110803223528)
+class AddCustomTeaserFieldToBlogPosts < ActiveRecord::Migration
+ def change
+ add_column Refinery::Blog::Post.table_name, :custom_teaser, :text
+ end
+end
+
diff --git a/db/migrate/20130611193508_add_primary_key_to_categorizations.refinery_blog.rb b/db/migrate/20130611193508_add_primary_key_to_categorizations.refinery_blog.rb
new file mode 100644
index 0000000..f55b314
--- /dev/null
+++ b/db/migrate/20130611193508_add_primary_key_to_categorizations.refinery_blog.rb
@@ -0,0 +1,15 @@
+# This migration comes from refinery_blog (originally 20110803223529)
+class AddPrimaryKeyToCategorizations < ActiveRecord::Migration
+ def up
+ unless Refinery::Categorization.column_names.include?("id")
+ add_column Refinery::Categorization.table_name, :id, :primary_key
+ end
+ end
+
+ def down
+ if Refinery::Categorization.column_names.include?("id")
+ remove_column Refinery::Categorization.table_name, :id
+ end
+ end
+end
+
diff --git a/db/migrate/20130611193509_add_source_url_to_blog_posts.refinery_blog.rb b/db/migrate/20130611193509_add_source_url_to_blog_posts.refinery_blog.rb
new file mode 100644
index 0000000..0489ba4
--- /dev/null
+++ b/db/migrate/20130611193509_add_source_url_to_blog_posts.refinery_blog.rb
@@ -0,0 +1,8 @@
+# This migration comes from refinery_blog (originally 20120103055909)
+class AddSourceUrlToBlogPosts < ActiveRecord::Migration
+ def change
+ add_column Refinery::Blog::Post.table_name, :source_url, :string
+ add_column Refinery::Blog::Post.table_name, :source_url_title, :string
+
+ end
+end
diff --git a/db/migrate/20130611193510_add_access_count_to_posts.refinery_blog.rb b/db/migrate/20130611193510_add_access_count_to_posts.refinery_blog.rb
new file mode 100644
index 0000000..76ad624
--- /dev/null
+++ b/db/migrate/20130611193510_add_access_count_to_posts.refinery_blog.rb
@@ -0,0 +1,9 @@
+# This migration comes from refinery_blog (originally 20120223022021)
+class AddAccessCountToPosts < ActiveRecord::Migration
+ def change
+ add_column Refinery::Blog::Post.table_name, :access_count, :integer, :default => 0
+
+ add_index Refinery::Blog::Post.table_name, :access_count
+
+ end
+end \ No newline at end of file
diff --git a/db/migrate/20130611193511_add_slug_to_posts_and_categories.refinery_blog.rb b/db/migrate/20130611193511_add_slug_to_posts_and_categories.refinery_blog.rb
new file mode 100644
index 0000000..a1091e9
--- /dev/null
+++ b/db/migrate/20130611193511_add_slug_to_posts_and_categories.refinery_blog.rb
@@ -0,0 +1,10 @@
+# This migration comes from refinery_blog (originally 20120227022021)
+class AddSlugToPostsAndCategories < ActiveRecord::Migration
+ def change
+ add_column Refinery::Blog::Post.table_name, :slug, :string
+ add_index Refinery::Blog::Post.table_name, :slug
+
+ add_column Refinery::Blog::Category.table_name, :slug, :string
+ add_index Refinery::Blog::Category.table_name, :slug
+ end
+end \ No newline at end of file
diff --git a/db/migrate/20130611193512_create_refinerycms_settings_schema.refinery_settings.rb b/db/migrate/20130611193512_create_refinerycms_settings_schema.refinery_settings.rb
new file mode 100644
index 0000000..6a736b7
--- /dev/null
+++ b/db/migrate/20130611193512_create_refinerycms_settings_schema.refinery_settings.rb
@@ -0,0 +1,17 @@
+# This migration comes from refinery_settings (originally 20100913234710)
+class CreateRefinerycmsSettingsSchema < ActiveRecord::Migration
+ def change
+ create_table :refinery_settings do |t|
+ t.string :name
+ t.text :value
+ t.boolean :destroyable, :default => true
+ t.string :scoping
+ t.boolean :restricted, :default => false
+ t.string :form_value_type
+
+ t.timestamps
+ end
+
+ add_index :refinery_settings, :name
+ end
+end
diff --git a/db/migrate/20130611193519_create_inquiries.refinery_inquiries.rb b/db/migrate/20130611193519_create_inquiries.refinery_inquiries.rb
new file mode 100644
index 0000000..83d2036
--- /dev/null
+++ b/db/migrate/20130611193519_create_inquiries.refinery_inquiries.rb
@@ -0,0 +1,25 @@
+# This migration comes from refinery_inquiries (originally 20101208082840)
+class CreateInquiries < ActiveRecord::Migration
+ def up
+ unless ::Refinery::Inquiries::Inquiry.table_exists?
+ create_table :refinery_inquiries_inquiries, :force => true do |t|
+ t.string :name
+ t.string :email
+ t.string :phone
+ t.text :message
+ t.boolean :spam, :default => false
+ t.timestamps
+ end
+
+ add_index :refinery_inquiries_inquiries, :id
+ end
+ end
+
+ def down
+ drop_table ::Refinery::Inquiries::Inquiry.table_name
+
+ ::Refinery::Page.delete_all({
+ :link_url => ("/contact" || "/contact/thank_you")
+ }) if defined?(::Refinery::Page)
+ end
+end
diff --git a/db/migrate/20130611193536_create_search_page.refinery_search.rb b/db/migrate/20130611193536_create_search_page.refinery_search.rb
new file mode 100644
index 0000000..d8c9509
--- /dev/null
+++ b/db/migrate/20130611193536_create_search_page.refinery_search.rb
@@ -0,0 +1,17 @@
+# This migration comes from refinery_search (originally 1)
+class CreateSearchPage < ActiveRecord::Migration
+
+ def up
+ end
+
+ def down
+ if defined?(Refinery::UserPlugin)
+ Refinery::UserPlugin.destroy_all({:name => "refinerycms_search"})
+ end
+
+ if defined?(Refinery::Page)
+ Refinery::Page.delete_all({:link_url => "/search"})
+ end
+ end
+
+end
diff --git a/db/migrate/20130611193607_create_page_images.refinery_page_images.rb b/db/migrate/20130611193607_create_page_images.refinery_page_images.rb
new file mode 100644
index 0000000..871bee3
--- /dev/null
+++ b/db/migrate/20130611193607_create_page_images.refinery_page_images.rb
@@ -0,0 +1,13 @@
+# This migration comes from refinery_page_images (originally 20101014230041)
+class CreatePageImages < ActiveRecord::Migration
+ def change
+ create_table Refinery::ImagePage.table_name, :id => false do |t|
+ t.integer :image_id
+ t.integer :page_id
+ t.integer :position
+ end
+
+ add_index Refinery::ImagePage.table_name, :image_id
+ add_index Refinery::ImagePage.table_name, :page_id
+ end
+end
diff --git a/db/migrate/20130611193608_add_caption_to_image_pages.refinery_page_images.rb b/db/migrate/20130611193608_add_caption_to_image_pages.refinery_page_images.rb
new file mode 100644
index 0000000..4b85eca
--- /dev/null
+++ b/db/migrate/20130611193608_add_caption_to_image_pages.refinery_page_images.rb
@@ -0,0 +1,6 @@
+# This migration comes from refinery_page_images (originally 20101014230042)
+class AddCaptionToImagePages < ActiveRecord::Migration
+ def change
+ add_column Refinery::ImagePage.table_name, :caption, :text
+ end
+end
diff --git a/db/migrate/20130611193609_translate_page_image_captions.refinery_page_images.rb b/db/migrate/20130611193609_translate_page_image_captions.refinery_page_images.rb
new file mode 100644
index 0000000..c2b3ebc
--- /dev/null
+++ b/db/migrate/20130611193609_translate_page_image_captions.refinery_page_images.rb
@@ -0,0 +1,23 @@
+# This migration comes from refinery_page_images (originally 20110511215016)
+class TranslatePageImageCaptions < ActiveRecord::Migration
+ def up
+ add_column Refinery::ImagePage.table_name, :id, :primary_key
+
+ Refinery::ImagePage.reset_column_information
+ unless defined?(Refinery::ImagePage::Translation) && Refinery::ImagePage::Translation.table_exists?
+ Refinery::ImagePage.create_translation_table!({
+ :caption => :text
+ }, {
+ :migrate_data => true
+ })
+ end
+ end
+
+ def down
+ Refinery::ImagePage.reset_column_information
+
+ Refinery::ImagePage.drop_translation_table! :migrate_data => true
+
+ remove_column Refinery::ImagePage.table_name, :id
+ end
+end
diff --git a/db/migrate/20130611193610_change_page_to_polymorphic.refinery_page_images.rb b/db/migrate/20130611193610_change_page_to_polymorphic.refinery_page_images.rb
new file mode 100644
index 0000000..d613730
--- /dev/null
+++ b/db/migrate/20130611193610_change_page_to_polymorphic.refinery_page_images.rb
@@ -0,0 +1,6 @@
+# This migration comes from refinery_page_images (originally 20110527052435)
+class ChangePageToPolymorphic < ActiveRecord::Migration
+ def change
+ add_column Refinery::ImagePage.table_name, :page_type, :string, :default => "page"
+ end
+end
diff --git a/db/migrate/20130611193620_create_videos_videos.refinery_videos.rb b/db/migrate/20130611193620_create_videos_videos.refinery_videos.rb
new file mode 100644
index 0000000..d1207d8
--- /dev/null
+++ b/db/migrate/20130611193620_create_videos_videos.refinery_videos.rb
@@ -0,0 +1,30 @@
+# This migration comes from refinery_videos (originally 1)
+class CreateVideosVideos < ActiveRecord::Migration
+
+ def up
+ create_table "refinery_videos", :force => true do |t|
+ t.integer "position"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "config"
+ t.string "title"
+ t.integer "poster_id"
+ t.boolean "use_shared"
+ t.text "embed_tag"
+ end
+ end
+
+ def down
+ if defined?(::Refinery::UserPlugin)
+ ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-videos"})
+ end
+
+ if defined?(::Refinery::Page)
+ ::Refinery::Page.delete_all({:link_url => "/videos/videos"})
+ end
+
+ drop_table :refinery_videos
+
+ end
+
+end
diff --git a/db/migrate/20130611193621_create_video_file.refinery_videos.rb b/db/migrate/20130611193621_create_video_file.refinery_videos.rb
new file mode 100644
index 0000000..e56ceac
--- /dev/null
+++ b/db/migrate/20130611193621_create_video_file.refinery_videos.rb
@@ -0,0 +1,26 @@
+# This migration comes from refinery_videos (originally 2)
+class CreateVideoFile < ActiveRecord::Migration
+
+ def up
+ create_table "refinery_video_files", :force => true do |t|
+ t.string "file_name"
+ t.integer "file_size"
+ t.string "file_ext"
+ t.string "file_uid"
+ t.string "file_mime_type"
+ t.integer "video_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "external_url"
+ t.boolean "use_external"
+ end
+
+ end
+
+ def down
+
+ drop_table :refinery_videos
+
+ end
+
+end