aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2013-01-25 21:53:05 +0100
committerHarald Eilertsen <haraldei@anduin.net>2013-01-25 21:53:05 +0100
commitf087c23c8600fe197d3a59f4a0cd839754459b37 (patch)
tree5577105a38545b143efec0bdb8c134bea04005c8 /db
downloadhmnoweb-f087c23c8600fe197d3a59f4a0cd839754459b37.tar.gz
hmnoweb-f087c23c8600fe197d3a59f4a0cd839754459b37.tar.bz2
hmnoweb-f087c23c8600fe197d3a59f4a0cd839754459b37.zip
Initial commit.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130124232352_create_refinerycms_authentication_schema.refinery_authentication.rb44
-rw-r--r--db/migrate/20130124232353_create_refinerycms_images_schema.refinery_images.rb16
-rw-r--r--db/migrate/20130124232354_create_refinerycms_resources_schema.refinery_resources.rb14
-rw-r--r--db/migrate/20130124232355_create_refinerycms_pages_schema.refinery_pages.rb59
-rw-r--r--db/migrate/20130124232356_create_seo_meta.seo_meta_engine.rb24
-rw-r--r--db/migrate/20130125203718_add_sessions_table.rb12
-rw-r--r--db/schema.rb162
-rw-r--r--db/seeds.rb10
8 files changed, 341 insertions, 0 deletions
diff --git a/db/migrate/20130124232352_create_refinerycms_authentication_schema.refinery_authentication.rb b/db/migrate/20130124232352_create_refinerycms_authentication_schema.refinery_authentication.rb
new file mode 100644
index 0000000..b306ecc
--- /dev/null
+++ b/db/migrate/20130124232352_create_refinerycms_authentication_schema.refinery_authentication.rb
@@ -0,0 +1,44 @@
+# This migration comes from refinery_authentication (originally 20100913234705)
+class CreateRefinerycmsAuthenticationSchema < ActiveRecord::Migration
+ def change
+ # Postgres apparently requires the roles_users table to exist before creating the roles table.
+ create_table :refinery_roles_users, :id => false do |t|
+ t.integer :user_id
+ t.integer :role_id
+ end
+
+ add_index :refinery_roles_users, [:role_id, :user_id]
+ add_index :refinery_roles_users, [:user_id, :role_id]
+
+ create_table :refinery_roles do |t|
+ t.string :title
+ end
+
+ create_table :refinery_user_plugins do |t|
+ t.integer :user_id
+ t.string :name
+ t.integer :position
+ end
+
+ add_index :refinery_user_plugins, :name
+ add_index :refinery_user_plugins, [:user_id, :name], :unique => true
+
+ create_table :refinery_users do |t|
+ t.string :username, :null => false
+ t.string :email, :null => false
+ t.string :encrypted_password, :null => false
+ t.datetime :current_sign_in_at
+ t.datetime :last_sign_in_at
+ t.string :current_sign_in_ip
+ t.string :last_sign_in_ip
+ t.integer :sign_in_count
+ t.datetime :remember_created_at
+ t.string :reset_password_token
+ t.datetime :reset_password_sent_at
+
+ t.timestamps
+ end
+
+ add_index :refinery_users, :id
+ end
+end
diff --git a/db/migrate/20130124232353_create_refinerycms_images_schema.refinery_images.rb b/db/migrate/20130124232353_create_refinerycms_images_schema.refinery_images.rb
new file mode 100644
index 0000000..94831c2
--- /dev/null
+++ b/db/migrate/20130124232353_create_refinerycms_images_schema.refinery_images.rb
@@ -0,0 +1,16 @@
+# This migration comes from refinery_images (originally 20100913234707)
+class CreateRefinerycmsImagesSchema < ActiveRecord::Migration
+ def change
+ create_table :refinery_images do |t|
+ t.string :image_mime_type
+ t.string :image_name
+ t.integer :image_size
+ t.integer :image_width
+ t.integer :image_height
+ t.string :image_uid
+ t.string :image_ext
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20130124232354_create_refinerycms_resources_schema.refinery_resources.rb b/db/migrate/20130124232354_create_refinerycms_resources_schema.refinery_resources.rb
new file mode 100644
index 0000000..e3e6264
--- /dev/null
+++ b/db/migrate/20130124232354_create_refinerycms_resources_schema.refinery_resources.rb
@@ -0,0 +1,14 @@
+# This migration comes from refinery_resources (originally 20100913234709)
+class CreateRefinerycmsResourcesSchema < ActiveRecord::Migration
+ def change
+ create_table :refinery_resources do |t|
+ t.string :file_mime_type
+ t.string :file_name
+ t.integer :file_size
+ t.string :file_uid
+ t.string :file_ext
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20130124232355_create_refinerycms_pages_schema.refinery_pages.rb b/db/migrate/20130124232355_create_refinerycms_pages_schema.refinery_pages.rb
new file mode 100644
index 0000000..8a8f425
--- /dev/null
+++ b/db/migrate/20130124232355_create_refinerycms_pages_schema.refinery_pages.rb
@@ -0,0 +1,59 @@
+# This migration comes from refinery_pages (originally 20100913234708)
+class CreateRefinerycmsPagesSchema < ActiveRecord::Migration
+ def up
+ create_table :refinery_page_parts do |t|
+ t.integer :refinery_page_id
+ t.string :title
+ t.text :body
+ t.integer :position
+
+ t.timestamps
+ end
+
+ add_index :refinery_page_parts, :id
+ add_index :refinery_page_parts, :refinery_page_id
+
+ create_table :refinery_pages do |t|
+ t.integer :parent_id
+ t.string :path
+ t.string :slug
+ t.boolean :show_in_menu, :default => true
+ t.string :link_url
+ t.string :menu_match
+ t.boolean :deletable, :default => true
+ t.boolean :draft, :default => false
+ t.boolean :skip_to_first_child, :default => false
+ t.integer :lft
+ t.integer :rgt
+ t.integer :depth
+ t.string :view_template
+ t.string :layout_template
+
+ t.timestamps
+ end
+
+ add_index :refinery_pages, :depth
+ add_index :refinery_pages, :id
+ add_index :refinery_pages, :lft
+ add_index :refinery_pages, :parent_id
+ add_index :refinery_pages, :rgt
+
+ Refinery::PagePart.create_translation_table!({
+ :body => :text
+ })
+
+ Refinery::Page.create_translation_table!({
+ :title => :string,
+ :custom_slug => :string,
+ :menu_title => :string,
+ :slug => :string
+ })
+ end
+
+ def down
+ drop_table :refinery_page_parts
+ drop_table :refinery_pages
+ Refinery::PagePart.drop_translation_table!
+ Refinery::Page.drop_translation_table!
+ end
+end
diff --git a/db/migrate/20130124232356_create_seo_meta.seo_meta_engine.rb b/db/migrate/20130124232356_create_seo_meta.seo_meta_engine.rb
new file mode 100644
index 0000000..7efd8dc
--- /dev/null
+++ b/db/migrate/20130124232356_create_seo_meta.seo_meta_engine.rb
@@ -0,0 +1,24 @@
+# This migration comes from seo_meta_engine (originally 20110329222114)
+class CreateSeoMeta < ActiveRecord::Migration
+
+ def self.up
+ create_table :seo_meta do |t|
+ t.integer :seo_meta_id
+ t.string :seo_meta_type
+
+ t.string :browser_title
+ t.string :meta_keywords
+ t.text :meta_description
+
+ t.timestamps
+ end
+
+ add_index :seo_meta, :id
+ add_index :seo_meta, [:seo_meta_id, :seo_meta_type]
+ end
+
+ def self.down
+ drop_table :seo_meta
+ end
+
+end
diff --git a/db/migrate/20130125203718_add_sessions_table.rb b/db/migrate/20130125203718_add_sessions_table.rb
new file mode 100644
index 0000000..4c87956
--- /dev/null
+++ b/db/migrate/20130125203718_add_sessions_table.rb
@@ -0,0 +1,12 @@
+class AddSessionsTable < ActiveRecord::Migration
+ def change
+ create_table :sessions do |t|
+ t.string :session_id, :null => false
+ t.text :data
+ t.timestamps
+ end
+
+ add_index :sessions, :session_id
+ add_index :sessions, :updated_at
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 0000000..8afc9c6
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,162 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20130125203718) do
+
+ create_table "refinery_images", :force => true do |t|
+ t.string "image_mime_type"
+ t.string "image_name"
+ t.integer "image_size"
+ t.integer "image_width"
+ t.integer "image_height"
+ t.string "image_uid"
+ t.string "image_ext"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "refinery_page_part_translations", :force => true do |t|
+ t.integer "refinery_page_part_id"
+ t.string "locale"
+ t.text "body"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "refinery_page_part_translations", ["locale"], :name => "index_refinery_page_part_translations_on_locale"
+ add_index "refinery_page_part_translations", ["refinery_page_part_id"], :name => "index_f9716c4215584edbca2557e32706a5ae084a15ef"
+
+ create_table "refinery_page_parts", :force => true do |t|
+ t.integer "refinery_page_id"
+ t.string "title"
+ t.text "body"
+ t.integer "position"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "refinery_page_parts", ["id"], :name => "index_refinery_page_parts_on_id"
+ add_index "refinery_page_parts", ["refinery_page_id"], :name => "index_refinery_page_parts_on_refinery_page_id"
+
+ create_table "refinery_page_translations", :force => true do |t|
+ t.integer "refinery_page_id"
+ t.string "locale"
+ t.string "title"
+ t.string "custom_slug"
+ t.string "menu_title"
+ t.string "slug"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "refinery_page_translations", ["locale"], :name => "index_refinery_page_translations_on_locale"
+ add_index "refinery_page_translations", ["refinery_page_id"], :name => "index_d079468f88bff1c6ea81573a0d019ba8bf5c2902"
+
+ create_table "refinery_pages", :force => true do |t|
+ t.integer "parent_id"
+ t.string "path"
+ t.string "slug"
+ t.boolean "show_in_menu", :default => true
+ t.string "link_url"
+ t.string "menu_match"
+ t.boolean "deletable", :default => true
+ t.boolean "draft", :default => false
+ t.boolean "skip_to_first_child", :default => false
+ t.integer "lft"
+ t.integer "rgt"
+ t.integer "depth"
+ t.string "view_template"
+ t.string "layout_template"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "refinery_pages", ["depth"], :name => "index_refinery_pages_on_depth"
+ add_index "refinery_pages", ["id"], :name => "index_refinery_pages_on_id"
+ add_index "refinery_pages", ["lft"], :name => "index_refinery_pages_on_lft"
+ add_index "refinery_pages", ["parent_id"], :name => "index_refinery_pages_on_parent_id"
+ add_index "refinery_pages", ["rgt"], :name => "index_refinery_pages_on_rgt"
+
+ create_table "refinery_resources", :force => true do |t|
+ t.string "file_mime_type"
+ t.string "file_name"
+ t.integer "file_size"
+ t.string "file_uid"
+ t.string "file_ext"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "refinery_roles", :force => true do |t|
+ t.string "title"
+ end
+
+ create_table "refinery_roles_users", :id => false, :force => true do |t|
+ t.integer "user_id"
+ t.integer "role_id"
+ end
+
+ add_index "refinery_roles_users", ["role_id", "user_id"], :name => "index_refinery_roles_users_on_role_id_and_user_id"
+ add_index "refinery_roles_users", ["user_id", "role_id"], :name => "index_refinery_roles_users_on_user_id_and_role_id"
+
+ create_table "refinery_user_plugins", :force => true do |t|
+ t.integer "user_id"
+ t.string "name"
+ t.integer "position"
+ end
+
+ add_index "refinery_user_plugins", ["name"], :name => "index_refinery_user_plugins_on_name"
+ add_index "refinery_user_plugins", ["user_id", "name"], :name => "index_refinery_user_plugins_on_user_id_and_name", :unique => true
+
+ create_table "refinery_users", :force => true do |t|
+ t.string "username", :null => false
+ t.string "email", :null => false
+ t.string "encrypted_password", :null => false
+ t.datetime "current_sign_in_at"
+ t.datetime "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.integer "sign_in_count"
+ t.datetime "remember_created_at"
+ t.string "reset_password_token"
+ t.datetime "reset_password_sent_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "refinery_users", ["id"], :name => "index_refinery_users_on_id"
+
+ create_table "seo_meta", :force => true do |t|
+ t.integer "seo_meta_id"
+ t.string "seo_meta_type"
+ t.string "browser_title"
+ t.string "meta_keywords"
+ t.text "meta_description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "seo_meta", ["id"], :name => "index_seo_meta_on_id"
+ add_index "seo_meta", ["seo_meta_id", "seo_meta_type"], :name => "index_seo_meta_on_seo_meta_id_and_seo_meta_type"
+
+ create_table "sessions", :force => true do |t|
+ t.string "session_id", :null => false
+ t.text "data"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
+ add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
+
+end
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 0000000..5e6468a
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1,10 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
+# Mayor.create(name: 'Emanuel', city: cities.first)
+
+# Added by Refinery CMS Pages extension
+Refinery::Pages::Engine.load_seed