Permalink
Browse files

slug migrations

  • Loading branch information...
1 parent b063244 commit 72e43af3f6316407796ff176a2b84ae89ca36d46 @voodoo-chile committed Aug 25, 2011
@@ -0,0 +1,10 @@
+class AddSlugToUsers < ActiveRecord::Migration
+ def self.up
+ add_column :users, :slug, :string
+ add_index :users, :slug, :unique => true
+ end
+
+ def self.down
+ remove_column :users, :slug
+ end
+end
@@ -0,0 +1,10 @@
+class AddSlugToNewsItems < ActiveRecord::Migration
+ def self.up
+ add_column :news_items, :slug, :string
+ add_index :news_items, :slug, :unique => true
+ end
+
+ def self.down
+ remove_column :news_items, :slug
+ end
+end

0 comments on commit 72e43af

Please sign in to comment.