public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
yaroslav (author)
Sun May 11 04:06:30 -0700 2008
commit  33a730791242bb12b2bcd8cfab0a59e2b750b725
tree    1d883f402575865a5d3bf8ea2cbf9a920812966a
parent  bc58c2c800ee1bb8e33b4054e8565ce7e19ee8fa
mephisto / db / migrate / 057_add_custom_settings.rb
100644 28 lines (24 sloc) 1.02 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class AddCustomSettings < ActiveRecord::Migration
  class Section < ActiveRecord::Base; end
  class Site < ActiveRecord::Base; end
 
  def self.up
    add_column "sites", "permalink_style", :string
    add_column "sites", "search_path", :string
    add_column "sites", "tag_path", :string
    add_column "sites", "search_template", :string
    add_column "sites", "tag_template", :string
    add_column "sections", "archive_path", :string
    add_column "sections", "archive_template", :string
    
    Site.update_all ['permalink_style = ?, search_path = ?, tag_path = ?', ':year/:month/:day/:permalink', 'search', 'tags']
    Section.update_all ['archive_path = ?', 'archives']
  end
 
  def self.down
    remove_column "sites", "permalink_style"
    remove_column "sites", "search_path"
    remove_column "sites", "tag_path"
    remove_column "sites", "search_template"
    remove_column "sites", "tag_template"
    remove_column "sections", "archive_path"
    remove_column "sections", "archive_template"
  end
end