Sha256: 9dae0f5d45264825c7c4e90f926c86c55f0ee8722ca2d45082cc8355c91db53f

Contents?: true

Size: 832 Bytes

Versions: 2

Compression:

Stored size: 832 Bytes

Contents

class CreateTestModels < ActiveRecord::Migration
  def self.up
    create_table :books, :force => true do |t|
      t.string :title
      t.string :author_name
      t.string :isbn
      t.integer :pub_year
      t.text :summary
    end
    
    create_table :chapters, :force => true do |t|
      t.integer :chapter_number
      t.string :title
      t.text :summary
      t.integer :book_id
    end
    
    create_table :users, :force => true do |t|
      t.string :name
    end
    
    create_table :groups, :force => true do |t|
      t.string :name
    end
    
    create_table :tags, :force => true do |t|
      t.string :name, :null => false
    end
    add_index :tags, [ :name ], :unique => true
  end

  def self.down
    drop_table :books
    drop_table :chapters
    drop_table :users
    drop_table :groups
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
my_annotations-0.6.0 test/app_root/db/migrate/001_create_test_models.rb
my_annotations-0.5.1 test/app_root/db/migrate/001_create_test_models.rb