Sha256: 0c8ed708bfec20f568e1badafefb38b8800729360f50a05502277e4223ac0cc0

Contents?: true

Size: 1.76 KB

Versions: 159

Compression:

Stored size: 1.76 KB

Contents

class CreateComeeCoreClientPrices < ActiveRecord::Migration[7.0]
  def change
    create_table :comee_core_client_prices do |t|
      t.date :valid_from, null: false
      t.date :valid_to, null: false
      t.float :price, null: false
      t.integer :status, null: false, default: 0
      t.integer :price_status, null: false, default: 0
      t.float :margin, null: false, default: 0
      t.integer :margin_type, null: false, default: 0
      t.references :product,
                   null: false,
                   index: {name: "product_on_cccp_indx"},
                   foreign_key: {to_table: :comee_core_products}
      t.references :client,
                   null: false,
                   index: {name: "client_on_cccp_indx"},
                   foreign_key: {to_table: :comee_core_clients}
      t.references :unit,
                   null: false,
                   index: {name: "unit_on_cccp_indx"},
                   foreign_key: {to_table: :comee_core_units}
      t.references :previous_price,
                   null: true,
                   index: {name: "previous_price_on_cccp_indx"},
                   foreign_key: {to_table: :comee_core_client_prices}
      t.references :next_price,
                   null: true,
                   index: {name: "next_price_on_cccp_indx"},
                   foreign_key: {to_table: :comee_core_client_prices}
      t.references :product_lookup,
                   null: true,
                   index: {name: "pl_on_cccp_indx"},
                   foreign_key: {to_table: :comee_core_product_lookups}

      t.timestamps
    end
    add_index :comee_core_client_prices,
              %i[product_id client_id previous_price_id next_price_id status],
              unique: true,
              name: "pi_ci_ppi_on_cccp_indx"
  end
end

Version data entries

159 entries across 159 versions & 1 rubygems

Version Path
comee_core-0.3.62 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.61 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.60 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.59 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.58 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.57 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.56 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.55 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.54 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.53 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.51 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.50 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.49 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.48 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.47 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.46 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.45 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.44 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.43 db/migrate/20230814151601_create_comee_core_client_prices.rb
comee_core-0.3.42 db/migrate/20230814151601_create_comee_core_client_prices.rb