MySQL - Error 1451 (23000) at line 1 - Cannot delete or update a parent row: A foreign key constraint fails
Here's everything relating to line 1:
CREATE TABLE item (
id INT NOT NULL,
name VARCHAR(50),
type SMALLINT NOT NULL DEFAULT 1,
cost INT NOT NULL DEFAULT 0,
member BOOLEAN NOT NULL DEFAULT FALSE,
bait BOOLEAN NOT NULL DEFAULT FALSE,
patched BOOLEAN NOT NULL DEFAULT FALSE,
legacy_inventory BOOLEAN NOT NULL DEFAULT FALSE,
vanilla_inventory BOOLEAN NOT NULL DEFAULT FALSE,
epf BOOLEAN NOT NULL DEFAULT FALSE,
tour BOOLEAN NOT NULL DEFAULT FALSE,
release_date DATE NOT NULL,
treasure BOOLEAN NOT NULL DEFAULT FALSE,
innocent BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (id)
);
ALTER TABLE item ALTER COLUMN release_date SET DEFAULT current_timestamp;
I don't see what's wrong - I had this exact text before which worked. Only thing I can think of is I accidentally typo'd in it and didn't notice, but it looks fine to me.
mariadb Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2