OSDN Git Service

t#32046:
[pettanr/pettanr.git] / db / migrate / 20130914061319_restruct_comic.rb
diff --git a/db/migrate/20130914061319_restruct_comic.rb b/db/migrate/20130914061319_restruct_comic.rb
new file mode 100644 (file)
index 0000000..3e3838f
--- /dev/null
@@ -0,0 +1,27 @@
+class RestructComic < ActiveRecord::Migration
+  def up
+    drop_table :comics
+    create_table :comics do |t|
+      t.string :title, :null => false, :limit => 100
+      t.integer :visible, :null => false, :default => 0
+      t.text :description
+      t.integer :author_id, :null => false
+
+      t.timestamps
+    end
+    drop_table :stories
+    create_table :stories do |t|
+      t.integer :comic_id, :null => false, :default => 0
+      t.string :title, :null => false, :limit => 100
+      t.integer :visible, :null => false, :default => 0
+      t.text :description
+      t.integer :author_id, :null => false, :default => 0
+      t.integer :t, :null => false, :default => 0
+
+      t.timestamps
+    end
+  end
+
+  def down
+  end
+end