Please cast your eyes over this....
There are no constraints referencing this table and the default table type is set to INNODB.
I am gratefull for any assistance anyone can provide.
Code:
mysql> CREATE TABLE labour(
-> labour_id INT AUTO_INCREMENT,
-> workdate DATE,
-> realstart TIME,
-> starttime TIME,
-> stoptime TIME,
-> CONSTRAINT PRIMARY KEY (labour_id)
-> );
Query OK, 0 rows affected (0.06 sec)
mysql> insert labour values (1, "2002-10-02", "00:00:00", "00:00:00", "00:00:00");
Query OK, 1 row affected (0.05 sec)
mysql> insert labour values (2, "2002-10-02", "00:00:00", "00:00:00", "00:00:00");
Query OK, 1 row affected (0.04 sec)
mysql> insert labour values (3, "2002-10-02", "00:00:00", "00:00:00", "00:00:00");
Query OK, 1 row affected (0.05 sec)
mysql> select * from labour;
+-----------+------------+-----------+-----------+----------+
| labour_id | workdate | realstart | starttime | stoptime |
+-----------+------------+-----------+-----------+----------+
| 1 | 2002-10-02 | 00:00:00 | 00:00:00 | 00:00:00 |
| 2 | 2002-10-02 | 00:00:00 | 00:00:00 | 00:00:00 |
| 3 | 2002-10-02 | 00:00:00 | 00:00:00 | 00:00:00 |
+-----------+------------+-----------+-----------+----------+
3 rows in set (0.00 sec)
mysql> delete from labour where labour_id = 3;
Query OK, 1 row affected (0.14 sec)
mysql> delete from labour where labour_id = 2;
Query OK, 1 row affected (0.13 sec)
mysql> delete from labour where labour_id = 5;
Query OK, 0 rows affected (0.00 sec)
mysql> delete from labour where labour_id = 1;
ERROR 1217: Cannot delete a parent row: a foreign key constraint fails
mysql>
There are no constraints referencing this table and the default table type is set to INNODB.
I am gratefull for any assistance anyone can provide.