OSDN Git Service

t#32046:
[pettanr/pettanr.git] / db / migrate / 20130914061319_restruct_comic.rb
1 class RestructComic < ActiveRecord::Migration
2   def up
3     drop_table :comics
4     create_table :comics do |t|
5       t.string :title, :null => false, :limit => 100
6       t.integer :visible, :null => false, :default => 0
7       t.text :description
8       t.integer :author_id, :null => false
9
10       t.timestamps
11     end
12     drop_table :stories
13     create_table :stories do |t|
14       t.integer :comic_id, :null => false, :default => 0
15       t.string :title, :null => false, :limit => 100
16       t.integer :visible, :null => false, :default => 0
17       t.text :description
18       t.integer :author_id, :null => false, :default => 0
19       t.integer :t, :null => false, :default => 0
20
21       t.timestamps
22     end
23   end
24
25   def down
26   end
27 end