defmodule DaProductApp.Repo.Migrations.CreatePosTransaction do use Ecto.Migration def change do create table(:pos_transaction, primary_key: false) do add :id, :bigint, primary_key: true, null: false add :s_txn_type, :string, size: 25 add :s_tid, :string, size: 8 add :s_mid, :string, size: 15 add :s_tid_stan, :string, size: 6 add :s_tid_invoiceno, :string, size: 6 add :s_tid_batchno, :string, size: 6 add :b_tid, :string, size: 8 add :b_mid, :string, size: 15 add :acquirer_id, :bigint add :b_tid_stan, :string, size: 6 add :b_tid_invoiceno, :string, size: 6 add :b_tid_batchno, :string, size: 6 add :b_tid_date, :string, size: 8 add :b_tid_time, :string, size: 6 add :entry_mode, :string, size: 3 add :condition_code, :string, size: 2 add :currency_code, :string, size: 3 add :mti, :string, size: 4 add :proc_code, :string, size: 6 add :total_amount, :decimal, precision: 12, scale: 2 add :auth_amount, :decimal, precision: 12, scale: 2 add :cash_amount, :decimal, precision: 12, scale: 2 add :tip_amount, :decimal, precision: 12, scale: 2 add :approval_code, :string, size: 6 add :reference_no, :string, size: 12 add :response_code, :string, size: 2 add :response_message, :string, size: 100 add :mcc_code, :string, size: 4 add :encrypted_track2, :string, size: 256 add :encrypted_pan, :string, size: 256 add :hash_pan, :string, size: 64 add :masked_card_no, :string, size: 19 add :encrypted_expiry, :string, size: 64 add :pan_seq, :string, size: 3 add :emv_data, :text add :acquirer_reference_no, :string, size: 23 add :scheme_reference_no, :string, size: 23 add :created_date_time, :naive_datetime add :updated_date_time, :naive_datetime add :metadata, :text end create index(:pos_transaction, [:b_tid, :b_mid]) create index(:pos_transaction, [:s_tid]) create index(:pos_transaction, [:created_date_time]) create index(:pos_transaction, [:response_code]) create index(:pos_transaction, [:approval_code]) create index(:pos_transaction, [:total_amount]) create index(:pos_transaction, [:mti]) end end