OSDN Git Service

b85283151fe4d1e282f3b075ba5afc3364452e47
[pettanr/pettanr.git] / db / migrate / 20111206130635_create_speaches.rb
1 class CreateSpeaches < ActiveRecord::Migration
2   def change
3     create_table :speaches do |t|
4       t.integer :balloon_id, :null => false
5       t.integer :speach_template_id, :null => false
6       t.string :content
7       t.integer :x, :null => false
8       t.integer :y, :null => false
9       t.integer :t, :null => false, :default => 1
10       t.integer :width, :null => false
11       t.integer :height, :null => false
12
13       t.timestamps
14     end
15     add_index :speaches, [:balloon_id]
16     add_index :speaches, [:balloon_id, :t], :unique => true, :name => 'speaches_bt'
17   end
18 end