Sha256: 7e96da96ac65e35d95c767a1a24a8eb203ae77058090040f48d24b9838c151a8

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 KB

Contents

class CreateEcomModelProjects < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_model_projects do |t|
      t.string :name, null: false
      t.string :description
      t.string :location, null: false
      t.string :objective
      t.string :project_scope
      t.references :employer, index: { name: 'employer_on_projects_indx' }
      t.references :contractor, index: { name: 'employer_on_contractor_indx' }
      t.references :consultant, index: { name: 'employer_on_consultant_indx' }
      t.references :project_manager, index: { name: 'employer_on_pm_indx' }
      t.references :task_template, index: { name: 'employer_on_tt_indx' }
      t.string :contract_number, null: false
      t.date :date_contract_signed, null: false
      t.date :commencement_date, null: false
      t.date :completion_date, null: false
      t.float :contract_amount, null: false
      t.float :advance_payment, null: false
      t.float :retention, null: false
      t.string :remark
      t.references :currency, index: { name: 'employer_on_currency_indx' }

      t.timestamps
    end

    add_foreign_key :ecom_model_projects, :ecom_model_stakeholders, column: :employer_id
    add_foreign_key :ecom_model_projects, :ecom_model_stakeholders, column: :contractor_id
    add_foreign_key :ecom_model_projects, :ecom_model_stakeholders, column: :consultant_id
    add_foreign_key :ecom_model_projects, :ecom_model_stakeholders, column: :project_manager_id
    add_foreign_key :ecom_model_projects, :ecom_model_task_templates, column: :task_template_id
    add_foreign_key :ecom_model_projects, :ecom_model_currencies, column: :currency_id
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ecom_model-2.0.4 db/migrate/20191201145848_create_ecom_model_projects.rb
ecom_model-2.0.3 db/migrate/20191201145848_create_ecom_model_projects.rb
ecom_model-2.0.2 db/migrate/20191201145848_create_ecom_model_projects.rb
ecom_model-2.0.1 db/migrate/20191201145848_create_ecom_model_projects.rb
ecom_model-2.0.0 db/migrate/20191201145848_create_ecom_model_projects.rb