Permalink
Browse files

time to refactor this thing. first: migrations

  • Loading branch information...
1 parent da77cf8 commit 743b48294552d9c6d509eb319af7e4dda5b02926 @tomash tomash committed Dec 12, 2010
@@ -1,12 +0,0 @@
-class CreatePaypalPayments < ActiveRecord::Migration
- def self.up
- create_table :paypal_payments do |t|
- t.references :order
- t.timestamps
- end
- end
-
- def self.down
- drop_table :paypal_payments
- end
-end
@@ -1,18 +0,0 @@
-class CreatePaypalTxns < ActiveRecord::Migration
- def self.up
- create_table :paypal_txns do |t|
- t.references :paypal_payment
- t.string :transaction_id
- t.decimal :amount, :precision => 8, :scale => 2
- t.decimal :fee, :precision => 8, :scale => 2
- t.string :currency_type
- t.string :status
- t.datetime :received_at
- t.timestamps
- end
- end
-
- def self.down
- drop_table :paypal_txns
- end
-end
@@ -1,13 +0,0 @@
-class AddEmailField < ActiveRecord::Migration
- def self.up
- change_table :paypal_payments do |t|
- t.string :email
- end
- end
-
- def self.down
- change_table :paypal_payments do |t|
- t.remove :email
- end
- end
-end
@@ -1,13 +0,0 @@
-class AddPayerId < ActiveRecord::Migration
- def self.up
- change_table :paypal_payments do |t|
- t.string :payer_id
- end
- end
-
- def self.down
- change_table :paypal_payments do |t|
- t.remove :payer_id
- end
- end
-end
@@ -1,13 +0,0 @@
-class RefactorPaymentsAsSti < ActiveRecord::Migration
- def self.up
- change_table :payments do |t|
- t.string :email
- t.string :payer_id
- end
- drop_table :paypal_payments
- end
-
- def self.down
- # No going back!
- end
-end
@@ -0,0 +1,15 @@
+class CreatePaymentNotifications < ActiveRecord::Migration
+ def self.up
+ create_table :payment_notifications do |t|
+ t.text :params
+ t.string :status
+ t.string :transaction_id
+ t.integer :order_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :payment_notifications
+ end
+end

0 comments on commit 743b482

Please sign in to comment.