Changeset 183 for trunk/examples/blog.rb

Show
Ignore:
Timestamp:
01/22/2007 20:45:51 (22 months ago)
Author:
codeFiend
Message:

Modified blog.rb example schema and session.rb schema to create proper primary keys rather than plain int() fields

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/blog.rb

    r182 r183  
    1818    class CreateTheBasics < V 1.0 
    1919      def self.up 
    20         create_table :blog_posts, :force => true, :id => false do |t| 
    21           t.column :id,       :integer, :null => false 
     20        create_table :blog_posts, :force => true do |t| 
     21          t.column :id,       :integer, :null => false, :primary_key => true, :auto_increment => true 
    2222          t.column :user_id,  :integer, :null => false 
    2323          t.column :title,    :string,  :limit => 255 
    2424          t.column :body,     :text 
    2525        end 
    26         create_table :blog_users, :force => true, :id => false do |t| 
    27           t.column :id,       :integer, :null => false 
     26        create_table :blog_users, :force => true do |t| 
     27          t.column :id,       :integer, :null => false, :primary_key => true, :auto_increment => true 
    2828          t.column :username, :string 
    2929          t.column :password, :string 
    3030        end 
    31         create_table :blog_comments, :force => true, :id => false do |t| 
    32           t.column :id,       :integer, :null => false 
     31        create_table :blog_comments, :force => true do |t| 
     32          t.column :id,       :integer, :null => false, :primary_key => true, :auto_increment => true 
    3333          t.column :post_id,  :integer, :null => false 
    3434          t.column :username, :string