Organizando plugins e gems.

This commit is contained in:
2009-07-16 11:51:47 -03:00
parent 4e22c87074
commit dcfc38eb09
506 changed files with 10538 additions and 45562 deletions

View File

@@ -0,0 +1,19 @@
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.column :name, :string
t.column :email, :string
t.column :age, :integer
t.column :ssn, :string
t.column :phone, :string
end
add_index :users, :email, :unique => true
add_index :users, :name
add_index :users, :age
add_index :users, [:email, :name], :unique => true
end
def self.down
drop_table :users
end
end

View File

@@ -0,0 +1,13 @@
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.column :user_id, :integer
t.column :title, :string
t.column :body, :text
end
end
def self.down
drop_table :posts
end
end

View File

@@ -0,0 +1,12 @@
class CreateTaggings < ActiveRecord::Migration
def self.up
create_table :taggings do |t|
t.column :post_id, :integer
t.column :tag_id, :integer
end
end
def self.down
drop_table :taggings
end
end

View File

@@ -0,0 +1,11 @@
class CreateTags < ActiveRecord::Migration
def self.up
create_table :tags do |t|
t.column :name, :string
end
end
def self.down
drop_table :tags
end
end

View File

@@ -0,0 +1,12 @@
class CreateDogs < ActiveRecord::Migration
def self.up
create_table :dogs do |t|
t.column :owner_id, :integer
t.column :address_id, :integer
end
end
def self.down
drop_table :dogs
end
end

View File

@@ -0,0 +1,14 @@
class CreateAddresses < ActiveRecord::Migration
def self.up
create_table :addresses do |t|
t.column :title, :string
t.column :addressable_id, :integer
t.column :addressable_type, :string
t.column :zip, :string
end
end
def self.down
drop_table :addresses
end
end

View File

@@ -0,0 +1,11 @@
class CreateFleas < ActiveRecord::Migration
def self.up
create_table :fleas do |t|
t.string :name
end
end
def self.down
drop_table :fleas
end
end

View File

@@ -0,0 +1,12 @@
class CreateDogsFleas < ActiveRecord::Migration
def self.up
create_table :dogs_fleas do |t|
t.integer :dog_id
t.integer :flea_id
end
end
def self.down
drop_table :dogs_fleas
end
end

View File

@@ -0,0 +1,17 @@
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.string :title
t.integer :price
t.integer :weight
t.string :size
t.boolean :tangible
t.timestamps
end
end
def self.down
drop_table :products
end
end

View File

@@ -0,0 +1,14 @@
class CreateFriendships < ActiveRecord::Migration
def self.up
create_table :friendships do |t|
t.integer :user_id
t.integer :friend_id
t.timestamps
end
end
def self.down
drop_table :friendships
end
end

View File

@@ -0,0 +1,12 @@
class CreateTreats < ActiveRecord::Migration
def self.up
create_table :treats do |t|
t.integer :dog_id
t.timestamps
end
end
def self.down
drop_table :treats
end
end