Wystąpił błąd podczas próby utworzenia tabeli w mysql.BŁĄD 1005 (HY000): Nie można utworzyć tabeli (errno: 150)
Jakieś wskazówki dotyczące rozwiązania problemu?
create table stock_in(
ind int not null auto_increment,
itemcode varchar(10) not null,
quantity int not null,
description text not null,
sales_ref int not null default -1,
return_outwards_ref int not null default -1,
stock_in_receipt_ref int not null default -1,
date text not null,
time text not null,
username text not null,
foreign key (sales_ref) references sales (receiptno),
foreign key (return_outwards_ref) references returnoutwards(ind),
primary key (ind)
);
Błąd:
ERROR 1005 (HY000): Can't create table 'posinventory.stock_in' (errno: 150)
Czy stworzyłeś tabele 'sales' i' returnoutwards' z unikalnymi kluczami? Wszystkie tabele muszą być InnoDb. – Devart
@Devart: Dzięki, znalazłem swój błąd ... to dlatego, że paragon w tabeli sprzedaży nie jest kluczem podstawowym ... Powinienem go odnieść do nowej kolumny z kluczem podstawowym, na przykład sales_no – Boon