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

DROP TABLE IF EXISTS `user_openid`;


CREATE TABLE `user_openid`
(
	`url` VARCHAR(255)  NOT NULL,
	`uid` INTEGER(11)  NOT NULL,
	`created_at` DATETIME  NOT NULL,
	`updated_at` DATETIME  NOT NULL,
	PRIMARY KEY (`url`),
	KEY `uo_i_url`(`url`),
	KEY `uo_i_uid`(`uid`),
	CONSTRAINT `uo_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;
