
# 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;

#-----------------------------------------------------------------------------
#-- user_facebook
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `user_facebook`;


CREATE TABLE `user_facebook`
(
	`fbuid` VARCHAR(255)  NOT NULL,
	`uid` INTEGER(11)  NOT NULL,
	`created_at` DATETIME  NOT NULL,
	`updated_at` DATETIME  NOT NULL,
	PRIMARY KEY (`fbuid`),
	KEY `ufb_i_fbuid`(`fbuid`),
	KEY `ufb_i_uid`(`uid`),
	CONSTRAINT `ufb_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;
