Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CreateSubscriptions < ActiveRecord::Migration
- def self.up
- create_table :subscriptions do |t|
- t.column :keyword_num, :integer
- t.column :user_id, :integer
- t.column :periodicity_pairing_id, :integer
- t.column :amount, :string
- t.column :last_billed_on, :date
- t.timestamps
- end
- end
- def self.down
- drop_table :subscriptions
- end
- end
- class CreatePlans < ActiveRecord::Migration
- def self.up
- create_table :plans do |t|
- t.column :name, :string
- t.column :description, :text
- t.timestamps
- end
- end
- def self.down
- drop_table :plans
- end
- end
- class CreatePeriodicities < ActiveRecord::Migration
- def self.up
- create_table :periodicities do |t|
- t.column :length_in_days, :integer
- t.timestamps
- end
- end
- def self.down
- drop_table :periodicities
- end
- end
- class CreatePeriodicityPlanPairings < ActiveRecord::Migration
- def self.up
- create_table :periodicity_plan_pairings do |t|
- t.column :plan_id, :integer
- t.column :periodicity_id, :integer
- t.decimal :price, :null => :no, :default => 0.0, :precision => 10, :scale => 2
- t.timestamps
- end
- end
- def self.down
- drop_table :periodicity_plan_pairings
- end
- end
- class AddserviceFeeAndSurchargeToSubscriptions < ActiveRecord::Migration
- def self.up
- add_column :subscriptions, :service_fee, :decimal, :null => :no, :default => 2.95, :precision => 10, :scale => 2
- add_column :subscriptions, :surcharge, :decimal, :null => :no, :default => 1.95, :precision => 10, :scale => 2
- end
- def self.down
- end
- end
Add Comment
Please, Sign In to add comment