Sha256: 54529abbd18a4fa5e58a1c6bfe9e6565eb9f0c9f6128df7fade87c340266f0f6

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literals: true

require "jobshop/helpers/migration.rb"

class CreateProducts < ActiveRecord::Migration[5.2]
  include Jobshop::Helpers::Migration

  def change
    create_table_with_auditing :jobshop_products, primary_key: %i[
      organization_id product_id
    ] do |t|
      t.citext :name, null: false
      t.text :description

      t.timestamps
    end

    add_index :jobshop_products, %i[ organization_id name ], unique: true

    fk_organization :jobshop_products
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jobshop-0.0.167 db/migrate/20171216022135_create_products.rb