Skip to content

Commit

Permalink
migration
Browse files Browse the repository at this point in the history
  • Loading branch information
scottkf committed Oct 22, 2010
1 parent 517344a commit 8eedbb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/migrate/20101018120638_create_categories_and_more.rb
Expand Up @@ -13,9 +13,9 @@ def self.up
add_column :articles, :category_id, :integer, :null => false, :default => 1
change_column :articles, :category_id, :integer, :null => false

#create default category
c = Category.create(:name => "Default", :layout => "application", :description => "default category", :url => "default")
Article.all.each {|a| a.category_id = c.id; a.save }
# #create default category
# c = Category.create(:name => "Default", :layout => "application", :description => "default category", :url => "default")
# Article.all.each {|a| a.category_id = c.id; a.save }

# rename normal role
r = Role.find(2)
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20101022133140_add_permalink_to_article.rb
Expand Up @@ -2,6 +2,7 @@ class AddPermalinkToArticle < ActiveRecord::Migration
def self.up
add_column :articles, :permalink, :string, :unique => true
add_index :articles, :permalink
# Article.all.each { |a| a.permalink = a.to_permalink; a.save; }
end

def self.down
Expand Down

0 comments on commit 8eedbb3

Please sign in to comment.