(11-10-2017, 01:26 AM)kaz050457 Wrote:Code:CREATE TABLE `vacation_notification` (`on_vacation` varchar(255) NOT NULL, notified` varchar(255) CHARACTER SET latin1 NOT NULL, `notified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`on_vacation`,`notified`), CONSTRAINT `vacation_notification_pkey` FOREIGN KEY (`on_vacation`) REFERENCES `vacation` (`email`) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Postfix Admin - Virtual Vacation Notifications';
error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '` varchar(255) CHARACTER SET latin1 NOT NULL, `notified_at` timestamp NOT NULL D' at line 1
First, start your own post with your specific issue instead of 'hijacking' another post.
This is a direct dump of my table, it should work for you:
Code:
CREATE TABLE `vacation_notification` (
`on_vacation` varchar(255) NOT NULL,
`notified` varchar(255) CHARACTER SET latin1 NOT NULL,
`notified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Postfix Admin - Virtual Vacation Notifications';
ALTER TABLE `vacation_notification`
ADD PRIMARY KEY (`on_vacation`,`notified`);
ALTER TABLE `vacation_notification`
ADD CONSTRAINT `vacation_notification_pkey` FOREIGN KEY (`on_vacation`) REFERENCES `vacation` (`email`) ON DELETE CASCADE;