· 6 years ago · Jun 25, 2019, 11:42 AM
1Results
2Schema Error: Error: ER_PARSE_ERROR: You have an error in
3 your SQL syntax; check the manual that corresponds to your
4 MySQL server version for the right syntax to use near
5'references frequentVisitorCoupons_coupons(couponId) on
6delete cascade )' at line 9
7
8// the sql for this error (first table is being referenced in the
9// 2nd where the error is
10CREATE TABLE IF NOT EXISTS frequentVisitorCoupons_coupons (
11 couponId mediumint not null auto_increment unique,
12 primary key (couponId),
13 totalHits mediumint not null,
14 isText boolean not null,
15 imageUrl text(1000)
16 );
17
18CREATE TABLE IF NOT EXISTS frequentVisitorCoupons_targets (
19 targetId mediumint not null auto_increment unique,
20 primary key (targetId),
21 isSitewide tinyint(1) not null,
22 targetUrl varchar(500),
23 displayThreshold tinyint(5) not null default 20,
24 offerCutoff tinyint(5),
25 fk_coupons_targets mediumint not null unique,
26 foreign key fk_coupons_targets references frequentVisitorCoupons_coupons(couponId) on delete cascade
27 );