propel:
  _attributes:              { package: plugins.stPaymentPaypalPlugin.lib.model }

  paypal_transaction:
    _attributes:            { phpName: PaypalTransaction, allowPkInsert: true }
    ptid:                   { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true }
    taid:                   { type: integer, size:  11, required: false }
    transaction_type:       { type: varchar, size: 255, required: true }                                # Type of transaction
    transaction_id:         { type: varchar, size: 255, required: true }                                # Subscription transaction id
    uid:                    { type: integer, size:  11, required: true }
    payer_id:               { type: varchar, size: 255, required: true }
    payer_email:            { type: varchar, size: 255, required: true }
    sum:                    { type: double,  size:  12, scale: 2, required: true, default: 0.00 }       # credits bought / sum paid
    created_at:             { type: timestamp, required: true }
    _foreignKeys:
      pt_fk_taid:           { foreignTable: payment_transaction_accounting, references: [ {local: taid, foreign: taid} ] }
      pt_fk_uid:            { foreignTable: user, references: [ {local: uid, foreign: uid} ] }
    _indexes:
      pt_i_taid:            [taid]
      pt_i_uid:             [uid]

  paypal_ipn_queue:
    _attributes:            { phpName: PaypalIPNQueue, allowPkInsert: true }
    piqid:                  { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true }
    status:                 { type: integer, size:  11, required: true, default: 0 } # 0=queued, 1=processed
    ipn_track_id:           { type: varchar, size: 255, required: true }
    txn_type:               { type: varchar, size: 255, required: true }
    subscriber_id:          { type: varchar, size: 255, required: true }
    ipn_data:               { type: longvarchar, required: true }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _indexes:
      piq_ipn_track_id:     [ipn_track_id]
      piq_txn_type:         [txn_type]
      piq_subscriber_id:    [subscriber_id]
