MySQL Forums
Forum List  »  French

Message : #1005 - Can't create table './symfonians/application.frm' (errno: 150)
Posted by: F RAHOBISOA
Date: August 27, 2008 05:20PM

Bonjour,
J'ai un souci sur cette base.
En copiant/collant ma base sql sur phpmyadmin, il m'informe qu'il y a un souci sur la requète "application", surement un problème de lien clé primaire/secondaire !???

Message : #1005 - Can't create table './symfonians/application.frm' (errno: 150)

Ma base :



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

#-----------------------------------------------------------------------------
#-- activation
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `activation`;


CREATE TABLE `activation`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`user_id` INTEGER NOT NULL,
`hash` VARCHAR(32) NOT NULL,
PRIMARY KEY (`id`),
KEY `activation_hash_index`(`hash`),
KEY `user_hash`(`user_id`, `hash`),
CONSTRAINT `activation_FK_1`
FOREIGN KEY (`user_id`)
REFERENCES `sf_guard_user` (`id`)
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- application
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `application`;


CREATE TABLE `application`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`submitter_id` INTEGER NOT NULL,
`name` VARCHAR(255) NOT NULL,
`slug` VARCHAR(255) NOT NULL,
`description` TEXT,
`homepage` VARCHAR(255),
`feed_url` VARCHAR(255),
`screenshot_path` VARCHAR(150),
`is_opensource` INTEGER default 0,
`licence` VARCHAR(30),
`country` VARCHAR(2),
`is_featured` INTEGER default 0,
`started_at` DATETIME,
`released_at` DATETIME,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
KEY `application_slug_index`(`slug`),
KEY `application_is_opensource_index`(`is_opensource`),
KEY `application_country_index`(`country`),
KEY `application_is_featured_index`(`is_featured`),
KEY `application_created_at_index`(`created_at`),
KEY `filter_index`(`country`, `created_at`, `is_featured`),
INDEX `application_FI_1` (`submitter_id`),
CONSTRAINT `application_FK_1`
FOREIGN KEY (`submitter_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE SET NULL
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- application_company
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `application_company`;


CREATE TABLE `application_company`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`company_id` INTEGER NOT NULL,
`application_id` INTEGER NOT NULL,
`submitter_id` INTEGER NOT NULL,
`role` VARCHAR(255),
`description` TEXT,
`started_at` DATETIME,
`ended_at` DATETIME,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
KEY `application_company_started_at_index`(`started_at`),
KEY `application_company_ended_at_index`(`ended_at`),
KEY `application_company_created_at_index`(`created_at`),
KEY `application_company_updated_at_index`(`updated_at`),
INDEX `application_company_FI_1` (`company_id`),
CONSTRAINT `application_company_FK_1`
FOREIGN KEY (`company_id`)
REFERENCES `company` (`id`)
ON DELETE CASCADE,
INDEX `application_company_FI_2` (`application_id`),
CONSTRAINT `application_company_FK_2`
FOREIGN KEY (`application_id`)
REFERENCES `application` (`id`)
ON DELETE CASCADE,
INDEX `application_company_FI_3` (`submitter_id`),
CONSTRAINT `application_company_FK_3`
FOREIGN KEY (`submitter_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE CASCADE
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- application_developer
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `application_developer`;


CREATE TABLE `application_developer`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`developer_id` INTEGER NOT NULL,
`application_id` INTEGER NOT NULL,
`role` VARCHAR(255),
`description` TEXT,
`started_at` DATETIME,
`ended_at` DATETIME,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
KEY `application_developer_started_at_index`(`started_at`),
KEY `application_developer_ended_at_index`(`ended_at`),
KEY `application_developer_created_at_index`(`created_at`),
KEY `application_developer_updated_at_index`(`updated_at`),
INDEX `application_developer_FI_1` (`developer_id`),
CONSTRAINT `application_developer_FK_1`
FOREIGN KEY (`developer_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE CASCADE,
INDEX `application_developer_FI_2` (`application_id`),
CONSTRAINT `application_developer_FK_2`
FOREIGN KEY (`application_id`)
REFERENCES `application` (`id`)
ON DELETE CASCADE
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- blog_posts
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `blog_posts`;


CREATE TABLE `blog_posts`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`slug` VARCHAR(255) NOT NULL,
`body` TEXT,
`author_id` INTEGER NOT NULL,
`is_published` INTEGER default 0 NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
KEY `blog_posts_is_published_index`(`is_published`),
KEY `blog_posts_created_at_index`(`created_at`),
KEY `blog_posts_updated_at_index`(`updated_at`),
KEY `post_index`(`slug`, `created_at`, `is_published`),
INDEX `blog_posts_FI_1` (`author_id`),
CONSTRAINT `blog_posts_FK_1`
FOREIGN KEY (`author_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE SET NULL
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- company
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `company`;


CREATE TABLE `company`
(
`name` VARCHAR(255) NOT NULL,
`summary` TEXT,
`slug` VARCHAR(255) NOT NULL,
`logo_path` VARCHAR(40),
`homepage` VARCHAR(255),
`address` TEXT,
`zip` VARCHAR(10),
`city` VARCHAR(50),
`state` VARCHAR(50),
`country` VARCHAR(2) NOT NULL,
`phone` VARCHAR(20),
`email` VARCHAR(100),
`submitter_id` INTEGER NOT NULL,
`allow_contact` INTEGER default 0,
`is_active` INTEGER default 1,
`created_at` DATETIME,
`updated_at` DATETIME,
`id` INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
KEY `company_slug_index`(`slug`),
KEY `company_country_index`(`country`),
KEY `company_created_at_index`(`created_at`),
KEY `filter_index`(`country`, `created_at`),
INDEX `company_FI_1` (`submitter_id`),
CONSTRAINT `company_FK_1`
FOREIGN KEY (`submitter_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE SET NULL
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- company_people
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `company_people`;


CREATE TABLE `company_people`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`user_id` INTEGER NOT NULL,
`company_id` INTEGER NOT NULL,
`role` VARCHAR(255),
`description` TEXT,
`started_at` DATETIME,
`ended_at` DATETIME,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
KEY `company_people_created_at_index`(`created_at`),
KEY `company_people_updated_at_index`(`updated_at`),
INDEX `company_people_FI_1` (`user_id`),
CONSTRAINT `company_people_FK_1`
FOREIGN KEY (`user_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE CASCADE,
INDEX `company_people_FI_2` (`company_id`),
CONSTRAINT `company_people_FK_2`
FOREIGN KEY (`company_id`)
REFERENCES `company` (`id`)
ON DELETE CASCADE
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- event
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `event`;


CREATE TABLE `event`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`type` VARCHAR(255) NOT NULL,
`source_model` VARCHAR(25) NOT NULL,
`source_name` VARCHAR(255) NOT NULL,
`source_slug` VARCHAR(255) NOT NULL,
`target_model` VARCHAR(255),
`target_name` VARCHAR(255),
`target_slug` VARCHAR(255),
`occured_at` DATETIME NOT NULL,
`is_admin` INTEGER default 0,
PRIMARY KEY (`id`),
KEY `event_type_index`(`type`),
KEY `event_occured_at_index`(`occured_at`),
KEY `event_is_admin_index`(`is_admin`),
KEY `filter_index`(`source_model`, `source_slug`, `occured_at`, `is_admin`)
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- jobs
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `jobs`;


CREATE TABLE `jobs`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`slug` VARCHAR(255) NOT NULL,
`summary` TEXT NOT NULL,
`company_id` INTEGER,
`contact_id` INTEGER NOT NULL,
`city` VARCHAR(50),
`state` VARCHAR(50),
`country` VARCHAR(2),
`teleworking` INTEGER default 0,
`expires_at` DATETIME,
`created_at` DATETIME,
`updated_at` DATETIME,
`budget` VARCHAR(255),
PRIMARY KEY (`id`),
KEY `jobs_title_index`(`title`),
KEY `jobs_slug_index`(`slug`),
KEY `jobs_country_index`(`country`),
KEY `jobs_teleworking_index`(`teleworking`),
KEY `jobs_expires_at_index`(`expires_at`),
KEY `jobs_created_at_index`(`created_at`),
KEY `filter_index`(`created_at`, `country`),
INDEX `jobs_FI_1` (`company_id`),
CONSTRAINT `jobs_FK_1`
FOREIGN KEY (`company_id`)
REFERENCES `company` (`id`)
ON DELETE CASCADE,
INDEX `jobs_FI_2` (`contact_id`),
CONSTRAINT `jobs_FK_2`
FOREIGN KEY (`contact_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE CASCADE
)Type=InnoDB;

#-----------------------------------------------------------------------------
#-- recommendation
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `recommendation`;


CREATE TABLE `recommendation`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`recommender_id` INTEGER NOT NULL,
`recommended_id` INTEGER NOT NULL,
`content` TEXT,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
KEY `recommendation_created_at_index`(`created_at`),
KEY `recommendation_updated_at_index`(`updated_at`),
KEY `filter_index`(`recommender_id`, `recommended_id`, `created_at`),
CONSTRAINT `recommendation_FK_1`
FOREIGN KEY (`recommender_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE CASCADE,
INDEX `recommendation_FI_2` (`recommended_id`),
CONSTRAINT `recommendation_FK_2`
FOREIGN KEY (`recommended_id`)
REFERENCES `sf_guard_user` (`id`)
ON DELETE CASCADE
)Type=InnoDB;

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


Merci pour votre aide.
@+

Options: ReplyQuote


Subject
Views
Written By
Posted
Message : #1005 - Can't create table './symfonians/application.frm' (errno: 150)
5706
August 27, 2008 05:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.