Sha256: a4bcc393b19f0757dd7c62c862bfbe49e31fca32108eb4f4655abc2e4f6925fc

Contents?: true

Size: 1.91 KB

Versions: 86

Compression:

Stored size: 1.91 KB

Contents

class CreateComeeCoreMasterPrices < ActiveRecord::Migration[7.0]
  def change
    create_table :comee_core_master_prices do |t|
      t.float :purchase_price, null: false
      t.float :selling_price, null: false
      t.date :valid_from, null: false
      t.date :valid_to, null: false
      t.integer :status, null: false, default: 0
      t.integer :price_status, null: false, default: 0
      t.boolean :primary, null: false, default: false
      t.float :margin, null: false, default: 0
      t.integer :lead_time
      t.references :product,
                   null: false,
                   index: {name: "product_on_ccmp_indx"},
                   foreign_key: {to_table: :comee_core_products}
      t.references :supplier,
                   null: false,
                   index: {name: "supplier_on_ccmp_indx"},
                   foreign_key: {to_table: :comee_core_suppliers}
      t.references :unit,
                   null: false,
                   index: {name: "unit_on_ccmp_indx"},
                   foreign_key: {to_table: :comee_core_units}
      t.references :previous_price,
                   null: true,
                   index: {name: "previous_price_on_ccsp_indx"},
                   foreign_key: {to_table: :comee_core_master_prices}
      t.references :next_price,
                   null: true,
                   index: {name: "next_price_on_ccsp_indx"},
                   foreign_key: {to_table: :comee_core_master_prices}
      t.references :product_lookup,
                   null: true,
                   index: {name: "pl_on_ccmp_indx"},
                   foreign_key: {to_table: :comee_core_product_lookups}
      t.boolean :propagated_to_client, null: false, default: false

      t.timestamps
    end

    add_index :comee_core_master_prices,
              %i[product_id supplier_id previous_price_id next_price_id status],
              unique: true,
              name: "pi_si_ppi_on_ccmp_indx"
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
comee_core-0.2.88 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.87 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.86 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.85 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.84 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.83 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.82 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.81 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.80 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.78 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.77 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.76 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.75 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.70 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.69 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.68 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.67 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.66 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.65 db/migrate/20230813235946_create_comee_core_master_prices.rb
comee_core-0.2.64 db/migrate/20230813235946_create_comee_core_master_prices.rb