CREATE TABLE `payment_transactions` (
  `id` int(11) NOT NULL,
  `parent_id` int(100) NOT NULL DEFAULT '0',
  `account_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `amount` float(10,4) NOT NULL DEFAULT '0.0000',
  `currency` varchar(50) NOT NULL,
  `stage` varchar(100) NOT NULL DEFAULT '',
  `payment_status` varchar(100) NOT NULL DEFAULT '',
  `status_reason` varchar(250) NOT NULL DEFAULT '',
  `gateway_id` int(11) NOT NULL DEFAULT '0',
  `payment_mode` varchar(100) NOT NULL DEFAULT '',
  `gateway_transaction_id` varchar(100) DEFAULT '',
  `gateway_status_reason` varchar(100) DEFAULT '',
  `insert_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
);
CREATE TABLE `account_funds` (
  `id` int(11) NOT NULL,
  `transaction_id` int(11) NOT NULL DEFAULT '0',
  `account_id` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `amount` float(10,4) NOT NULL DEFAULT '0.0000',
  `currency` varchar(50) NOT NULL,
  `payment_status` varchar(100) NOT NULL DEFAULT '',
  `debit_credit` enum('DEBIT','CREDIT') NOT NULL,
  `commments` varchar(50) NOT NULL,
  `insert_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
);

CREATE TABLE `gateways` (
  `id` int(11) NOT NULL,
  `gateways_name` varchar(100) NOT NULL DEFAULT '',
  `commments` varchar(50) NOT NULL,
  `insert_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
);
ALTER TABLE `payment_transactions` ADD `transaction_id` VARCHAR( 32 ) NOT NULL AFTER `id` ;
