OSDN Git Service

決済プラグインのベースとなるmigrateを追加
authorTaro Matsuzawa <tmatsuzawa@kbmj.com>
Fri, 20 Aug 2010 07:19:35 +0000 (16:19 +0900)
committerTaro Matsuzawa <tmatsuzawa@kbmj.com>
Fri, 20 Aug 2010 07:19:35 +0000 (16:19 +0900)
db/migrate/20100819114504_create_payment_plugins.rb [new file with mode: 0644]
db/migrate/20100819115306_add_payment_plugin_id_to_payment.rb [new file with mode: 0644]

diff --git a/db/migrate/20100819114504_create_payment_plugins.rb b/db/migrate/20100819114504_create_payment_plugins.rb
new file mode 100644 (file)
index 0000000..1e29ccc
--- /dev/null
@@ -0,0 +1,17 @@
+class CreatePaymentPlugins < ActiveRecord::Migration
+  def self.up
+    create_table :payment_plugins do |t|
+      t.column :name, :string, :comment => "プラグイン名"
+      t.column :model_name, :string, :comment => "モデル名"
+      t.column :detail, :text, :comment => "詳細"
+      t.column :enable, :integer, :comment => "有効/無効"
+      t.column :created_at, :datetime, :comment => "作成日"
+      t.column :updated_at, :datetime, :comment => "更新日"
+      t.column :deleted_at, :datetime, :comment => "削除日"
+    end
+  end
+
+  def self.down
+    drop_table :payment_plugins
+  end
+end
diff --git a/db/migrate/20100819115306_add_payment_plugin_id_to_payment.rb b/db/migrate/20100819115306_add_payment_plugin_id_to_payment.rb
new file mode 100644 (file)
index 0000000..78c5ec1
--- /dev/null
@@ -0,0 +1,9 @@
+class AddPaymentPluginIdToPayment < ActiveRecord::Migration
+  def self.up
+    add_column :payments, :payment_plugin_id, :integer, :comment => "支払いプラグインID"
+  end
+
+  def self.down
+    remove_column :payments, :payment_plugin_id
+  end
+end