OSDN Git Service

import all source code
[pettanr/pettanr.git] / db / migrate / 20111206115439_create_balloon_templates.rb
1 class CreateBalloonTemplates < ActiveRecord::Migration
2   def change
3     create_table :balloon_templates do |t|
4       t.integer :speach_balloon_id, :null => false
5       t.integer :resource_picture_id, :null => false
6       t.integer :tail, :null => false, :default => 1
7       t.integer :border, :null => false, :default => 1
8       t.integer :min_width, :null => false, :default => 0
9       t.integer :max_width, :null => false, :default => 0
10       t.integer :min_height, :null => false, :default => 0
11       t.integer :max_height, :null => false, :default => 0
12
13       t.timestamps
14     end
15     add_index :balloon_templates, [:speach_balloon_id]
16     add_index :balloon_templates, [:speach_balloon_id, :tail, :border], :unique => true, :name => 'sb_tb'
17   end
18 end