
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;

#-----------------------------------------------------------------------------
#-- paypal_transaction
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `paypal_transaction`;


CREATE TABLE `paypal_transaction`
(
	`ptid` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`transaction_id` VARCHAR(255)  NOT NULL,
	`transaction_type` VARCHAR(255)  NOT NULL,
	`uid` INTEGER(11)  NOT NULL,
	`payer_id` VARCHAR(255)  NOT NULL,
	`payer_email` VARCHAR(255)  NOT NULL,
	`sum` DOUBLE(12,2) default 0 NOT NULL,
	`created_at` DATETIME  NOT NULL,
	PRIMARY KEY (`ptid`),
	KEY `pay_pt_i_uid`(`uid`),
	CONSTRAINT `pay_pt_fk_uid`
		FOREIGN KEY (`uid`)
		REFERENCES `user` (`uid`)
)Engine=InnoDB;

# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
