diff --git a/Gemfile b/Gemfile index fcf7b39d4..d6278d87c 100644 --- a/Gemfile +++ b/Gemfile @@ -32,6 +32,8 @@ gem 'cancancan', '~> 1.9' # for checking member privileges gem 'gibbon' # for Mailchimp newsletter subscriptions gem 'csv_shaper' # CSV export +gem 'comfortable_mexican_sofa', '~> 1.12.0' # content management system + # vendored activemerchant for testing- needed for bogus paypal # gateway monkeypatch gem 'activemerchant', '1.33.0', diff --git a/Gemfile.lock b/Gemfile.lock index d54873d81..48afdd1da 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,6 +33,8 @@ GEM activesupport (= 4.1.9) builder (~> 3.1) erubis (~> 2.7.0) + active_link_to (1.0.2) + actionpack activemodel (4.1.9) activesupport (= 4.1.9) builder (~> 3.1) @@ -48,6 +50,9 @@ GEM tzinfo (~> 1.1) addressable (2.3.6) arel (5.0.1.20140414130214) + autoprefixer-rails (5.1.1) + execjs + json bcrypt (3.1.9) better_errors (2.0.0) coderay (>= 1.0.0) @@ -58,6 +63,10 @@ GEM bluecloth (2.2.0) bootstrap-datepicker-rails (1.3.0.2) railties (>= 3.0) + bootstrap-sass (3.3.3) + autoprefixer-rails (>= 5.0.0.1) + sass (>= 3.2.19) + bootstrap_form (2.2.0) builder (3.2.2) byebug (3.5.1) columnize (~> 0.8) @@ -73,7 +82,13 @@ GEM capybara-email (2.4.0) capybara (~> 2.4) mail + climate_control (0.0.3) + activesupport (>= 3.0) cliver (0.3.2) + cocaine (0.5.5) + climate_control (>= 0.0.3, < 1.0) + codemirror-rails (4.8) + railties (>= 3.0, < 5) coderay (1.1.0) coffee-rails (4.1.0) coffee-script (>= 2.2.0) @@ -83,6 +98,21 @@ GEM execjs coffee-script-source (1.8.0) columnize (0.9.0) + comfortable_mexican_sofa (1.12.7) + active_link_to (>= 1.0.0) + bootstrap-sass (>= 3.2.0) + bootstrap_form (>= 2.2.0) + codemirror-rails (>= 3.0.0) + coffee-rails (>= 3.1.0) + haml-rails (>= 0.3.0) + jquery-rails (>= 3.0.0) + jquery-ui-rails (>= 5.0.0) + kramdown (>= 1.0.0) + paperclip (>= 4.0.0) + plupload-rails (>= 1.2.1) + rails (>= 4.0.0, < 5) + rails-i18n (>= 4.0.0) + sass-rails (>= 4.0.3) commonjs (0.2.7) coveralls (0.7.1) multi_json (~> 1.3) @@ -171,6 +201,7 @@ GEM sprockets-rails json (1.8.2) kgio (2.9.2) + kramdown (1.5.0) launchy (2.4.3) addressable (~> 2.3) leaflet-markercluster-rails (0.7.0) @@ -212,7 +243,14 @@ GEM multi_json (~> 1.3) omniauth-oauth (~> 1.0) orm_adapter (0.5.0) + paperclip (4.2.1) + activemodel (>= 3.0.0) + activesupport (>= 3.0.0) + cocaine (~> 0.5.3) + mime-types pg (0.17.1) + plupload-rails (1.2.1) + rails (>= 3.1) poltergeist (1.5.1) capybara (~> 2.1) cliver (~> 0.3.1) @@ -237,6 +275,9 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 4.1.9) sprockets-rails (~> 2.0) + rails-i18n (4.0.3) + i18n (~> 0.6) + railties (~> 4.0) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging @@ -348,6 +389,7 @@ DEPENDENCIES capybara capybara-email coffee-rails (~> 4.1.0) + comfortable_mexican_sofa (~> 1.12.0) coveralls csv_shaper dalli diff --git a/app/assets/javascripts/comfy/admin/cms/custom.js.coffee b/app/assets/javascripts/comfy/admin/cms/custom.js.coffee new file mode 100644 index 000000000..d40d4c9c3 --- /dev/null +++ b/app/assets/javascripts/comfy/admin/cms/custom.js.coffee @@ -0,0 +1 @@ +# Custom JS for the admin area \ No newline at end of file diff --git a/app/assets/stylesheets/comfy/admin/cms/custom.sass b/app/assets/stylesheets/comfy/admin/cms/custom.sass new file mode 100644 index 000000000..328d897f1 --- /dev/null +++ b/app/assets/stylesheets/comfy/admin/cms/custom.sass @@ -0,0 +1 @@ +// custom CSS for admin area \ No newline at end of file diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb new file mode 100644 index 000000000..e8f8dfa35 --- /dev/null +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -0,0 +1,121 @@ +# encoding: utf-8 + +ComfortableMexicanSofa.configure do |config| + # Title of the admin area + # config.cms_title = 'ComfortableMexicanSofa CMS Engine' + + # Controller that is inherited from CmsAdmin::BaseController + # config.base_controller = 'ApplicationController' + + # Module responsible for authentication. You can replace it with your own. + # It simply needs to have #authenticate method. See http_auth.rb for reference. + # config.admin_auth = 'ComfyAdminAuthentication' + + # Module responsible for authorization on admin side. It should have #authorize + # method that returns true or false based on params and loaded instance + # variables available for a given controller. + # config.admin_authorization = 'ComfyAdminAuthorization' + + # Module responsible for public authentication. Similar to the above. You also + # will have access to @cms_site, @cms_layout, @cms_page so you can use them in + # your logic. Default module doesn't do anything. + # config.public_auth = 'ComfyPublicAuthentication' + + # When arriving at /cms-admin you may chose to redirect to arbirtary path, + # for example '/cms-admin/users' + # config.admin_route_redirect = '' + + # File uploads use Paperclip and can support filesystem or s3 uploads. Override + # the upload method and appropriate settings based on Paperclip. For S3 see: + # http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3, and for + # filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem + # If you are using S3 and HTTPS, pass :s3_protocol => '' to have URLs that use the protocol of the page + # config.upload_file_options = {:url => '/system/:class/:id/:attachment/:style/:filename'} + + # Sofa allows you to setup entire site from files. Database is updated with each + # request (if necessary). Please note that database entries are destroyed if there's + # no corresponding file. Fixtures are disabled by default. + # config.enable_fixtures = false + + # Path where fixtures can be located. + # config.fixtures_path = File.expand_path('db/cms_fixtures', Rails.root) + + # Importing fixtures into Database + # To load fixtures into the database just run this rake task: + # local: $ rake comfortable_mexican_sofa:fixtures:import FROM=example.local TO=localhost + # Heroku: $ heroku run rake comfortable_mexican_sofa:fixtures:import FROM=example.local TO=yourapp.herokuapp.com + # From indicates folder the fixtures are in and to is the Site hostname you have defined in the database. + + # Exporting fixtures into Files + # If you need to dump database contents into fixture files run: + # local: $ rake comfortable_mexican_sofa:fixtures:export FROM=localhost TO=example.local + # Heroku: $ heroku run rake comfortable_mexican_sofa:fixtures:export FROM=yourapp.herokuapp.com TO=example.local + # This will create example.local folder and dump all content from example.com Site. + + # Content for Layouts, Pages and Snippets has a revision history. You can revert + # a previous version using this system. You can control how many revisions per + # object you want to keep. Set it to 0 if you wish to turn this feature off. + # config.revisions_limit = 25 + + # Locale definitions. If you want to define your own locale merge + # {:locale => 'Locale Title'} with this. + # config.locales = {:en => 'English', :es => 'Español'} + + # Admin interface will respect the locale of the site being managed. However you can + # force it to English by setting this to `:en` + # config.admin_locale = nil + + # A class that is included as a sweeper to admin base controller if it's set + # config.admin_cache_sweeper = nil + + # By default you cannot have irb code inside your layouts/pages/snippets. + # Generally this is to prevent putting something like this: + # <% User.delete_all %> but if you really want to allow it... + # config.allow_irb = false + + # Whitelist of all helper methods that can be used via {{cms:helper}} tag. By default + # all helpers are allowed except `eval`, `send`, `call` and few others. Empty array + # will prevent rendering of all helpers. + # config.allowed_helpers = nil + + # Whitelist of partials paths that can be used via {{cms:partial}} tag. All partials + # are accessible by default. Empty array will prevent rendering of all partials. + # config.allowed_partials = nil + + # Site aliases, if you want to have aliases for your site. Good for harmonizing + # production env with dev/testing envs. + # e.g. config.hostname_aliases = {'host.com' => 'host.inv', 'host_a.com' => ['host.lvh.me', 'host.dev']} + # Default is nil (not used) + # config.hostname_aliases = nil + + # Reveal partials that can be overwritten in the admin area. + # Default is false. + # config.reveal_cms_partials = false + +end + +# Default credentials for ComfortableMexicanSofa::AccessControl::AdminAuthentication +# YOU REALLY WANT TO CHANGE THIS BEFORE PUTTING YOUR SITE LIVE +ComfortableMexicanSofa::AccessControl::AdminAuthentication.username = 'username' +ComfortableMexicanSofa::AccessControl::AdminAuthentication.password = 'password' + +# Uncomment this module and `config.admin_auth` above to use custom admin authentication +# module ComfyAdminAuthentication +# def authenticate +# return true +# end +# end + +# Uncomment this module and `config.admin_authorization` above to use custom admin authorization +# module ComfyAdminAuthorization +# def authorize +# return true +# end +# end + +# Uncomment this module and `config.public_auth` above to use custom public authentication +# module ComfyPublicAuthentication +# def authenticate +# return true +# end +# end diff --git a/config/routes.rb b/config/routes.rb index ceca68687..a6d29bc9d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,10 @@ Growstuff::Application.routes.draw do + comfy_route :cms_admin, :path => '/admin' + + # Make sure this routeset is defined last + comfy_route :cms, :path => '/', :sitemap => false + resources :plant_parts devise_for :members, :controllers => { :registrations => "registrations", :passwords => "passwords" } diff --git a/db/cms_fixtures/sample-site/categories/files.yml b/db/cms_fixtures/sample-site/categories/files.yml new file mode 100644 index 000000000..2e59d3264 --- /dev/null +++ b/db/cms_fixtures/sample-site/categories/files.yml @@ -0,0 +1 @@ +- File Category \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/categories/pages.yml b/db/cms_fixtures/sample-site/categories/pages.yml new file mode 100644 index 000000000..fec395558 --- /dev/null +++ b/db/cms_fixtures/sample-site/categories/pages.yml @@ -0,0 +1 @@ +- Page Category \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/categories/snippets.yml b/db/cms_fixtures/sample-site/categories/snippets.yml new file mode 100644 index 000000000..a7d06fda6 --- /dev/null +++ b/db/cms_fixtures/sample-site/categories/snippets.yml @@ -0,0 +1 @@ +- Snippet Category \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/files/_sample.jpg.yml b/db/cms_fixtures/sample-site/files/_sample.jpg.yml new file mode 100644 index 000000000..b978f0651 --- /dev/null +++ b/db/cms_fixtures/sample-site/files/_sample.jpg.yml @@ -0,0 +1,5 @@ +label: Fixture File +description: Fixture Description +categories: + - category_a + - category_b \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/files/sample.jpg b/db/cms_fixtures/sample-site/files/sample.jpg new file mode 100644 index 000000000..2b3a42b36 Binary files /dev/null and b/db/cms_fixtures/sample-site/files/sample.jpg differ diff --git a/db/cms_fixtures/sample-site/layouts/default/attributes.yml b/db/cms_fixtures/sample-site/layouts/default/attributes.yml new file mode 100644 index 000000000..6f1626b7c --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/attributes.yml @@ -0,0 +1 @@ +label: Default Fixture Layout \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/content.html b/db/cms_fixtures/sample-site/layouts/default/content.html new file mode 100644 index 000000000..f2707392b --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/content.html @@ -0,0 +1,5 @@ + + + {{ cms:page:content }} + + \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/javascript.js b/db/cms_fixtures/sample-site/layouts/default/javascript.js new file mode 100644 index 000000000..6959d8bfc --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/javascript.js @@ -0,0 +1 @@ +// default js \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml b/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml new file mode 100644 index 000000000..754f082c4 --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml @@ -0,0 +1,2 @@ +label: Default Fixture Nested Layout +position: 42 \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/content.haml b/db/cms_fixtures/sample-site/layouts/default/nested/content.haml new file mode 100644 index 000000000..2f09fd402 --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/content.haml @@ -0,0 +1,3 @@ +{{ cms:page_file:thumbnail:url }} +.left {{ cms:page:left }} +.right {{ cms:page:right }} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js b/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js new file mode 100644 index 000000000..2508c22ed --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js @@ -0,0 +1 @@ +// nested js \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css b/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css new file mode 100644 index 000000000..034f6fb9c --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css @@ -0,0 +1 @@ +div{float:left} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/layouts/default/stylesheet.css b/db/cms_fixtures/sample-site/layouts/default/stylesheet.css new file mode 100644 index 000000000..cd8b4f19d --- /dev/null +++ b/db/cms_fixtures/sample-site/layouts/default/stylesheet.css @@ -0,0 +1 @@ +body{color: red} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/attributes.yml b/db/cms_fixtures/sample-site/pages/index/attributes.yml new file mode 100644 index 000000000..56616f972 --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/attributes.yml @@ -0,0 +1,6 @@ +label: Home Fixture Page +layout: default +target_page: '/child' +categories: + - category_a + - category_b \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/child/attributes.yml b/db/cms_fixtures/sample-site/pages/index/child/attributes.yml new file mode 100644 index 000000000..d8602e148 --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/child/attributes.yml @@ -0,0 +1,3 @@ +label: Child Fixture Page +layout: nested +position: 42 diff --git a/db/cms_fixtures/sample-site/pages/index/child/left.haml b/db/cms_fixtures/sample-site/pages/index/child/left.haml new file mode 100644 index 000000000..756907e5e --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/child/left.haml @@ -0,0 +1 @@ += "Child Page Left Fixture Content" \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/child/right.html b/db/cms_fixtures/sample-site/pages/index/child/right.html new file mode 100644 index 000000000..3ac08e9ab --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/child/right.html @@ -0,0 +1 @@ +Child Page Right Fixture Content \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png b/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png new file mode 100644 index 000000000..89cf33f55 Binary files /dev/null and b/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png differ diff --git a/db/cms_fixtures/sample-site/pages/index/content.html b/db/cms_fixtures/sample-site/pages/index/content.html new file mode 100644 index 000000000..fb97a42a7 --- /dev/null +++ b/db/cms_fixtures/sample-site/pages/index/content.html @@ -0,0 +1,2 @@ +Home Page Fixture Contént +{{ cms:snippet:default }} \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/snippets/default/attributes.yml b/db/cms_fixtures/sample-site/snippets/default/attributes.yml new file mode 100644 index 000000000..2113c3ce6 --- /dev/null +++ b/db/cms_fixtures/sample-site/snippets/default/attributes.yml @@ -0,0 +1,4 @@ +label: Default Fixture Snippet +categories: + - category_a + - category_b \ No newline at end of file diff --git a/db/cms_fixtures/sample-site/snippets/default/content.html b/db/cms_fixtures/sample-site/snippets/default/content.html new file mode 100644 index 000000000..48a4995fa --- /dev/null +++ b/db/cms_fixtures/sample-site/snippets/default/content.html @@ -0,0 +1 @@ +Fixture Content for Default Snippet \ No newline at end of file diff --git a/db/migrate/20150201052245_create_cms.rb b/db/migrate/20150201052245_create_cms.rb new file mode 100644 index 000000000..9e999488f --- /dev/null +++ b/db/migrate/20150201052245_create_cms.rb @@ -0,0 +1,140 @@ +class CreateCms < ActiveRecord::Migration + + def self.up + + text_limit = case ActiveRecord::Base.connection.adapter_name + when 'PostgreSQL' + { } + else + { :limit => 16777215 } + end + + # -- Sites -------------------------------------------------------------- + create_table :comfy_cms_sites do |t| + t.string :label, :null => false + t.string :identifier, :null => false + t.string :hostname, :null => false + t.string :path + t.string :locale, :null => false, :default => 'en' + t.boolean :is_mirrored, :null => false, :default => false + end + add_index :comfy_cms_sites, :hostname + add_index :comfy_cms_sites, :is_mirrored + + # -- Layouts ------------------------------------------------------------ + create_table :comfy_cms_layouts do |t| + t.integer :site_id, :null => false + t.integer :parent_id + t.string :app_layout + t.string :label, :null => false + t.string :identifier, :null => false + t.text :content, text_limit + t.text :css, text_limit + t.text :js, text_limit + t.integer :position, :null => false, :default => 0 + t.boolean :is_shared, :null => false, :default => false + t.timestamps + end + add_index :comfy_cms_layouts, [:parent_id, :position] + add_index :comfy_cms_layouts, [:site_id, :identifier], :unique => true + + # -- Pages -------------------------------------------------------------- + create_table :comfy_cms_pages do |t| + t.integer :site_id, :null => false + t.integer :layout_id + t.integer :parent_id + t.integer :target_page_id + t.string :label, :null => false + t.string :slug + t.string :full_path, :null => false + t.text :content_cache, text_limit + t.integer :position, :null => false, :default => 0 + t.integer :children_count, :null => false, :default => 0 + t.boolean :is_published, :null => false, :default => true + t.boolean :is_shared, :null => false, :default => false + t.timestamps + end + add_index :comfy_cms_pages, [:site_id, :full_path] + add_index :comfy_cms_pages, [:parent_id, :position] + + # -- Page Blocks -------------------------------------------------------- + create_table :comfy_cms_blocks do |t| + t.string :identifier, :null => false + t.text :content, text_limit + t.references :blockable, :polymorphic => true + t.timestamps + end + add_index :comfy_cms_blocks, [:identifier] + add_index :comfy_cms_blocks, [:blockable_id, :blockable_type] + + # -- Snippets ----------------------------------------------------------- + create_table :comfy_cms_snippets do |t| + t.integer :site_id, :null => false + t.string :label, :null => false + t.string :identifier, :null => false + t.text :content, text_limit + t.integer :position, :null => false, :default => 0 + t.boolean :is_shared, :null => false, :default => false + t.timestamps + end + add_index :comfy_cms_snippets, [:site_id, :identifier], :unique => true + add_index :comfy_cms_snippets, [:site_id, :position] + + # -- Files -------------------------------------------------------------- + create_table :comfy_cms_files do |t| + t.integer :site_id, :null => false + t.integer :block_id + t.string :label, :null => false + t.string :file_file_name, :null => false + t.string :file_content_type, :null => false + t.integer :file_file_size, :null => false + t.string :description, :limit => 2048 + t.integer :position, :null => false, :default => 0 + t.timestamps + end + add_index :comfy_cms_files, [:site_id, :label] + add_index :comfy_cms_files, [:site_id, :file_file_name] + add_index :comfy_cms_files, [:site_id, :position] + add_index :comfy_cms_files, [:site_id, :block_id] + + # -- Revisions ----------------------------------------------------------- + create_table :comfy_cms_revisions, :force => true do |t| + t.string :record_type, :null => false + t.integer :record_id, :null => false + t.text :data, text_limit + t.datetime :created_at + end + add_index :comfy_cms_revisions, [:record_type, :record_id, :created_at], + :name => 'index_cms_revisions_on_rtype_and_rid_and_created_at' + + # -- Categories --------------------------------------------------------- + create_table :comfy_cms_categories, :force => true do |t| + t.integer :site_id, :null => false + t.string :label, :null => false + t.string :categorized_type, :null => false + end + add_index :comfy_cms_categories, [:site_id, :categorized_type, :label], :unique => true, + :name => 'index_cms_categories_on_site_id_and_cat_type_and_label' + + create_table :comfy_cms_categorizations, :force => true do |t| + t.integer :category_id, :null => false + t.string :categorized_type, :null => false + t.integer :categorized_id, :null => false + end + add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], :unique => true, + :name => 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id' + end + + def self.down + drop_table :comfy_cms_sites + drop_table :comfy_cms_layouts + drop_table :comfy_cms_pages + drop_table :comfy_cms_snippets + drop_table :comfy_cms_blocks + drop_table :comfy_cms_files + drop_table :comfy_cms_revisions + drop_table :comfy_cms_categories + drop_table :comfy_cms_categorizations + end +end + diff --git a/db/schema.rb b/db/schema.rb index 9e593a422..91a3b597a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150127043022) do +ActiveRecord::Schema.define(version: 20150201052245) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -53,6 +53,125 @@ ActiveRecord::Schema.define(version: 20150127043022) do add_index "authentications", ["member_id"], name: "index_authentications_on_member_id", using: :btree + create_table "comfy_cms_blocks", force: true do |t| + t.string "identifier", null: false + t.text "content" + t.integer "blockable_id" + t.string "blockable_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_blocks", ["blockable_id", "blockable_type"], name: "index_comfy_cms_blocks_on_blockable_id_and_blockable_type", using: :btree + add_index "comfy_cms_blocks", ["identifier"], name: "index_comfy_cms_blocks_on_identifier", using: :btree + + create_table "comfy_cms_categories", force: true do |t| + t.integer "site_id", null: false + t.string "label", null: false + t.string "categorized_type", null: false + end + + add_index "comfy_cms_categories", ["site_id", "categorized_type", "label"], name: "index_cms_categories_on_site_id_and_cat_type_and_label", unique: true, using: :btree + + create_table "comfy_cms_categorizations", force: true do |t| + t.integer "category_id", null: false + t.string "categorized_type", null: false + t.integer "categorized_id", null: false + end + + add_index "comfy_cms_categorizations", ["category_id", "categorized_type", "categorized_id"], name: "index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id", unique: true, using: :btree + + create_table "comfy_cms_files", force: true do |t| + t.integer "site_id", null: false + t.integer "block_id" + t.string "label", null: false + t.string "file_file_name", null: false + t.string "file_content_type", null: false + t.integer "file_file_size", null: false + t.string "description", limit: 2048 + t.integer "position", default: 0, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_files", ["site_id", "block_id"], name: "index_comfy_cms_files_on_site_id_and_block_id", using: :btree + add_index "comfy_cms_files", ["site_id", "file_file_name"], name: "index_comfy_cms_files_on_site_id_and_file_file_name", using: :btree + add_index "comfy_cms_files", ["site_id", "label"], name: "index_comfy_cms_files_on_site_id_and_label", using: :btree + add_index "comfy_cms_files", ["site_id", "position"], name: "index_comfy_cms_files_on_site_id_and_position", using: :btree + + create_table "comfy_cms_layouts", force: true do |t| + t.integer "site_id", null: false + t.integer "parent_id" + t.string "app_layout" + t.string "label", null: false + t.string "identifier", null: false + t.text "content" + t.text "css" + t.text "js" + t.integer "position", default: 0, null: false + t.boolean "is_shared", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_layouts", ["parent_id", "position"], name: "index_comfy_cms_layouts_on_parent_id_and_position", using: :btree + add_index "comfy_cms_layouts", ["site_id", "identifier"], name: "index_comfy_cms_layouts_on_site_id_and_identifier", unique: true, using: :btree + + create_table "comfy_cms_pages", force: true do |t| + t.integer "site_id", null: false + t.integer "layout_id" + t.integer "parent_id" + t.integer "target_page_id" + t.string "label", null: false + t.string "slug" + t.string "full_path", null: false + t.text "content_cache" + t.integer "position", default: 0, null: false + t.integer "children_count", default: 0, null: false + t.boolean "is_published", default: true, null: false + t.boolean "is_shared", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_pages", ["parent_id", "position"], name: "index_comfy_cms_pages_on_parent_id_and_position", using: :btree + add_index "comfy_cms_pages", ["site_id", "full_path"], name: "index_comfy_cms_pages_on_site_id_and_full_path", using: :btree + + create_table "comfy_cms_revisions", force: true do |t| + t.string "record_type", null: false + t.integer "record_id", null: false + t.text "data" + t.datetime "created_at" + end + + add_index "comfy_cms_revisions", ["record_type", "record_id", "created_at"], name: "index_cms_revisions_on_rtype_and_rid_and_created_at", using: :btree + + create_table "comfy_cms_sites", force: true do |t| + t.string "label", null: false + t.string "identifier", null: false + t.string "hostname", null: false + t.string "path" + t.string "locale", default: "en", null: false + t.boolean "is_mirrored", default: false, null: false + end + + add_index "comfy_cms_sites", ["hostname"], name: "index_comfy_cms_sites_on_hostname", using: :btree + add_index "comfy_cms_sites", ["is_mirrored"], name: "index_comfy_cms_sites_on_is_mirrored", using: :btree + + create_table "comfy_cms_snippets", force: true do |t| + t.integer "site_id", null: false + t.string "label", null: false + t.string "identifier", null: false + t.text "content" + t.integer "position", default: 0, null: false + t.boolean "is_shared", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "comfy_cms_snippets", ["site_id", "identifier"], name: "index_comfy_cms_snippets_on_site_id_and_identifier", unique: true, using: :btree + add_index "comfy_cms_snippets", ["site_id", "position"], name: "index_comfy_cms_snippets_on_site_id_and_position", using: :btree + create_table "comments", force: true do |t| t.integer "post_id", null: false t.integer "author_id", null: false @@ -139,6 +258,7 @@ ActiveRecord::Schema.define(version: 20150127043022) do t.decimal "weight_quantity" t.string "weight_unit" t.integer "plant_part_id" + t.float "si_weight" end create_table "harvests_photos", id: false, force: true do |t|