{
  "version": "5",
  "dialect": "mysql",
  "id": "c1aeefc2-cf16-461f-80f6-3e3e02b1dcf5",
  "prevId": "00000000-0000-0000-0000-000000000000",
  "tables": {
    "lspg_gateways": {
      "name": "lspg_gateways",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "code": {
          "name": "code",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "lspg_gateways_id": {
          "name": "lspg_gateways_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "lspg_gateways_code_unique": {
          "name": "lspg_gateways_code_unique",
          "columns": [
            "code"
          ]
        }
      },
      "checkConstraint": {}
    },
    "lspg_organization_gateway_mappings": {
      "name": "lspg_organization_gateway_mappings",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "gateway_id": {
          "name": "gateway_id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "credentials": {
          "name": "credentials",
          "type": "json",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('active','inactive')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'active'"
        },
        "mode": {
          "name": "mode",
          "type": "enum('sandbox','production')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'sandbox'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {
        "idx_ogm_org_status": {
          "name": "idx_ogm_org_status",
          "columns": [
            "organization_id",
            "status"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "fk_ogm_organization_id": {
          "name": "fk_ogm_organization_id",
          "tableFrom": "lspg_organization_gateway_mappings",
          "tableTo": "lspg_organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "fk_ogm_gateway_id": {
          "name": "fk_ogm_gateway_id",
          "tableFrom": "lspg_organization_gateway_mappings",
          "tableTo": "lspg_gateways",
          "columnsFrom": [
            "gateway_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "lspg_organization_gateway_mappings_id": {
          "name": "lspg_organization_gateway_mappings_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "lspg_organizations": {
      "name": "lspg_organizations",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "lspg_organizations_id": {
          "name": "lspg_organizations_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "lspg_payment_profiles": {
      "name": "lspg_payment_profiles",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "organization_gateway_mapping_id": {
          "name": "organization_gateway_mapping_id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "customer_profile_id": {
          "name": "customer_profile_id",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "payment_profile_id": {
          "name": "payment_profile_id",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "payment_profile_token": {
          "name": "payment_profile_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "fk_pp_ogm_id": {
          "name": "fk_pp_ogm_id",
          "tableFrom": "lspg_payment_profiles",
          "tableTo": "lspg_organization_gateway_mappings",
          "columnsFrom": [
            "organization_gateway_mapping_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "lspg_payment_profiles_id": {
          "name": "lspg_payment_profiles_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "lspg_transactions_logs": {
      "name": "lspg_transactions_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": true
        },
        "txn_id": {
          "name": "txn_id",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "organization_gateway_mapping_id": {
          "name": "organization_gateway_mapping_id",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "amount": {
          "name": "amount",
          "type": "decimal(10,2)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('paid','remaining','refunded','declined','voided','refund-voided')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'remaining'"
        },
        "status": {
          "name": "status",
          "type": "enum('pending','success','failed','processing','cancelled')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "req_to_gateway": {
          "name": "req_to_gateway",
          "type": "json",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "res_from_gateway": {
          "name": "res_from_gateway",
          "type": "json",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "req_time": {
          "name": "req_time",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "res_time": {
          "name": "res_time",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "comments": {
          "name": "comments",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "CURRENT_TIMESTAMP"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "CURRENT_TIMESTAMP"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "fk_txn_ogm_id": {
          "name": "fk_txn_ogm_id",
          "tableFrom": "lspg_transactions_logs",
          "tableTo": "lspg_organization_gateway_mappings",
          "columnsFrom": [
            "organization_gateway_mapping_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "lspg_transactions_logs_id": {
          "name": "lspg_transactions_logs_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "lspg_transactions_logs_txn_id_unique": {
          "name": "lspg_transactions_logs_txn_id_unique",
          "columns": [
            "txn_id"
          ]
        }
      },
      "checkConstraint": {}
    }
  },
  "views": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "tables": {},
    "indexes": {}
  }
}