2019-05-21 16:07:40 +02:00
|
|
|
class CreateInvoicingProfiles < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
create_table :invoicing_profiles do |t|
|
|
|
|
t.references :user, index: true, foreign_key: true
|
|
|
|
t.string :first_name
|
|
|
|
t.string :last_name
|
2019-05-29 14:28:14 +02:00
|
|
|
t.string :email
|
2019-05-21 16:07:40 +02:00
|
|
|
|
|
|
|
t.timestamps null: false
|
|
|
|
end
|
2019-05-22 12:45:45 +02:00
|
|
|
|
|
|
|
add_reference :organizations, :invoicing_profile, index: true, foreign_key: true
|
2019-05-22 17:49:22 +02:00
|
|
|
add_reference :invoices, :invoicing_profile, index: true, foreign_key: true
|
2019-06-04 16:50:23 +02:00
|
|
|
add_reference :wallets, :invoicing_profile, index: true, foreign_key: true
|
|
|
|
add_reference :wallet_transactions, :invoicing_profile, index: true, foreign_key: true
|
|
|
|
add_reference :history_values, :invoicing_profile, index: true, foreign_key: true
|
2019-06-12 12:22:38 +02:00
|
|
|
|
|
|
|
add_column :invoices, :operator_profile_id, :integer
|
|
|
|
add_foreign_key :invoices, :invoicing_profiles, column: :operator_profile_id, primary_key: :id
|
2019-05-21 16:07:40 +02:00
|
|
|
end
|
|
|
|
end
|