Skip to content

sql showing error  #1

@Behramand

Description

@Behramand

Error
SQL query:

CREATE TABLE orders (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
Title varchar(255) DEFAULT NULL,
First varchar(255) DEFAULT NULL,
Middle varchar(255) DEFAULT NULL,
Last varchar(255) DEFAULT NULL,
ProductId int(11) unsigned NOT NULL,
NumberShipped int(11) DEFAULT NULL,
OrderDate date DEFAULT NULL,
PRIMARY KEY (id),
KEY order_product_fk (ProductId),
CONSTRAINT order_product_fk FOREIGN KEY (ProductId) REFERENCES products (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
MySQL said: Documentation

#1005 - Can't create table inventorymanager_2017-06-22.orders (errno: 150 "Foreign key constraint is incorrectly formed") (Details…)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions