CREATE TABLE IF NOT EXISTS `rentsoft_payment_$mid` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `txid` varchar(64) NOT NULL,
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `cid` int(11) NOT NULL,
  `comment` varchar(255) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `status` tinyint(5) NOT NULL,
  `product_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `txid` (`txid`)
);

CREATE TABLE IF NOT EXISTS `rentsoft_product_$mid` (
  `id` int(11) NOT NULL auto_increment,
  `serviceKey` varchar(64) NOT NULL,
  `serviceName` varchar(64) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `serviceKey` (`serviceName`)
);

CREATE TABLE IF NOT EXISTS `rentsoft_subscribtion_product_$mid` (
  `cid` int(11) NOT NULL,
  `pid` int(11) NOT NULL,
  `status` tinyint(5) NOT NULL,
  PRIMARY KEY  (`cid`,`pid`)
);

ALTER TABLE `rentsoft_payment_$mid` CHANGE COLUMN `amount` `amount` decimal(12,2) NOT NULL;