MySQL - błąd przy tworzeniu tabeli

0

Podczas tworzenia tabeli:

CREATE TABLE IF NOT EXISTS account(
id_account_pk INT NOT NULL AUTO_INCREMENT,
id_account_group_fk INT NOT NULL,
id_company_fk INT NOT NULL,
id_language_fk INT NOT NULL,
password VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL,
name VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL,
second_name VARCHAR(128) COLLATE utf8_unicode_ci,
lastname VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL,
birthday TIMESTAMP,
role VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL,
email_address VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL,
second_email_address VARCHAR(128) COLLATE utf8_unicode_ci,
phone_number VARCHAR(128) COLLATE utf8_unicode_ci,
second_phone_number VARCHAR(128) COLLATE utf8_unicode_ci,
zip_code VARCHAR(128) COLLATE utf8_unicode_ci,
street VARCHAR(128) COLLATE utf8_unicode_ci,
city VARCHAR(128) COLLATE utf8_unicode_ci,
state VARCHAR(128) COLLATE utf8_unicode_ci,
country VARCHAR(128) COLLATE utf8_unicode_ci,
property_number VARCHAR(5) COLLATE utf8_unicode_ci,
apartment_number VARCHAR(5) COLLATE utf8_unicode_ci,
social_gg VARCHAR(128) COLLATE utf8_unicode_ci,
social_facebook VARCHAR(128) COLLATE utf8_unicode_ci,
social_twitter  VARCHAR(128) COLLATE utf8_unicode_ci,
social_skype VARCHAR(128) COLLATE utf8_unicode_ci,
social_vk VARCHAR(128) COLLATE utf8_unicode_ci,
register_date TIMESTAMP NOT NULL,
PRIMARY KEY (id_account_pk),
INDEX (id_account_pk),
FOREIGN KEY (id_account_group_fk) REFERENCES account_group(id_account_group_pk),
FOREIGN KEY (id_company_fk) REFERENCES company(id_company_pk),
FOREIGN KEY (id_language_fk) REFERENCES language(id_language_fk)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Otrzymuje następujący komunikat:

Static analysis:

3 błędów zostało znalezionych podczas analizy.

A symbol name was expected! (near "password" at position 175)
Unexpected beginning of statement. (near "128" at position 192)
Unrecognized statement type. (near "COLLATE" at position 197)
Zapytanie SQL:

CREATE TABLE IF NOT EXISTS account( id_account_pk INT NOT NULL AUTO_INCREMENT, id_account_group_fk INT NOT NULL, id_company_fk INT NOT NULL, id_language_fk INT NOT NULL, password VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL, name VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL, second_name VARCHAR(128) COLLATE utf8_unicode_ci, lastname VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL, birthday TIMESTAMP, role VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL, email_address VARCHAR(128) COLLATE utf8_unicode_ci NOT NULL, second_email_address VARCHAR(128) COLLATE utf8_unicode_ci, phone_number VARCHAR(128) COLLATE utf8_unicode_ci, second_phone_number VARCHAR(128) COLLATE utf8_unicode_ci, zip_code VARCHAR(128) COLLATE utf8_unicode_ci, street VARCHAR(128) COLLATE utf8_unicode_ci, city VARCHAR(128) COLLATE utf8_unicode_ci, state VARCHAR(128) COLLATE utf8_unicode_ci, country VARCHAR(128) COLLATE utf8_unicode_ci, property_number VARCHAR(5) COLLATE utf8_unicode_ci, apartment_number VARCHAR(5) COLLATE utf8_unicode_ci, social_gg VARCHAR(128) COLLATE utf8_unicode_ci, social_facebook VARCHAR(128) COLLATE utf8_unicode_ci, social_twitter VARCHAR(128) COLLATE utf8_unicode_ci, social_skype VARCHAR(128) COLLATE utf8_unicode_ci, social_vk VARCHAR(128) COLLATE utf8_unicode_ci, register_date TIMESTAMP NOT NULL, PRIMARY KEY (id_account_pk), INDEX (id_account_pk), FOREIGN KEY (id_account_group_fk) REFERENCES account_group(id_account_group_pk), FOREIGN KEY (id_company_fk) REFERENCES company(id_company_pk), FOREIGN KEY (id_language_fk) REFERENCES language(id_language_fk) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

MySQL zwrócił komunikat: Dokumentacja

#1215 - Cannot add foreign key constraint

Czy wie ktoś o co chodzi? Pozdrawiam.

PS. Pozostałe tabele istnieją i mają wprowadzone dane.

4

Daj nazwy pól w grawisach -`
Masz część pol które są słowami kluczowymi dla MySQL

1 użytkowników online, w tym zalogowanych: 0, gości: 1