以下 2 个表的创建失败。谁能帮帮我吗?
错误是 MySQL:无法创建表(错误号:150)
CREATE TABLE PSODEMO.APPLICATION (
APPLICATION_ID INT NOT NULL AUTO_INCREMENT
, APPLICATION_TYPE VARCHAR(10)
, APPLICATION_STATUS VARCHAR(10)
, CREATE_DATE DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL
, MODIFIED_DATE DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL
, DEALER_ID INT
, COMPANY_NAME VARCHAR(120)
, WEBSITE VARCHAR(128)
, EMAIL VARCHAR(64)
, PHONE VARCHAR(32)
, STREET VARCHAR(124)
, CITY VARCHAR(64)
, ZIPCODE INT NOT NULL
, COUNTRY VARCHAR(64)
, DEALER_STATUS VARCHAR(32)
, REMARKS VARCHAR(128)
, INVOICE_ID INT
, PAYMENT_MODE VARCHAR(64)
, INVOICE_DATE DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL
, PAYMENT_DATE DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL
, PAYMENT_STATUS VARCHAR(64)
, PRIMARY KEY (APPLICATION_ID)
, KEY ix_APPLICATION_Applicationid(aplication_id)
, KEY ix_APPLICATION_dealerid(dealer_id)
);
CREATE TABLE LOGIN (
LOGIN_ID INT NOT NULL AUTO_INCREMENT
, USERNAME VARCHAR(10) NOT NULL
, PASSWORD VARCHAR(10) NOT NULL
, USER_TYPE VARCHAR(1) NOT NULL
, APPLICATION_ID_FK INT
, DEALER_ID_FK INT
, PRIMARY KEY (LOGIN_ID)
, FOREIGN KEY (APPLICATION_ID_FK) REFERENCES APPLICATION(APPLICATION_ID)
, FOREIGN KEY (DEALER_ID_FK) REFERENCES DEALER(DEALER_ID)
, UNIQUE (USERNAME)
);