CREATE TABLE IF NOT EXISTS `paykeeper_transaction_$mid` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contract_id` int(11) DEFAULT NULL,
  `payment_id` int(11) NOT NULL DEFAULT '0',
  `create_date` datetime NOT NULL,
  `transaction_date` timestamp NULL DEFAULT NULL,
  `order_id` varchar(50) DEFAULT NULL,
  `sum` decimal(12,2) NOT NULL DEFAULT '0',
  `status` varchar(30),
  `params` text,
  PRIMARY KEY (`id`),
  KEY `contract_id` (`contract_id`),
  KEY `create_date` (`create_date`),
  KEY `status` (`status`)
);
