Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MATCH SIMPLE from my.sql #140

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sample/exclude/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CREATE TABLE `posts` (
PRIMARY KEY (`id`),
UNIQUE KEY `user_id` (`user_id`,`title`),
KEY `posts_user_id_idx` (`id`) USING BTREE,
CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Posts table'
```

Expand Down
2 changes: 1 addition & 1 deletion sample/exclude/user_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CREATE TABLE `user_options` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`user_id`),
CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='User options table'
```

Expand Down
2 changes: 1 addition & 1 deletion sample/mysql/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CREATE TABLE `posts` (
PRIMARY KEY (`id`),
UNIQUE KEY `user_id` (`user_id`,`title`),
KEY `posts_user_id_idx` (`id`) USING BTREE,
CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Posts table'
```

Expand Down
2 changes: 1 addition & 1 deletion sample/mysql/user_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CREATE TABLE `user_options` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`user_id`),
CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='User options table'
```

Expand Down
2 changes: 1 addition & 1 deletion sample/svg/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CREATE TABLE `posts` (
PRIMARY KEY (`id`),
UNIQUE KEY `user_id` (`user_id`,`title`),
KEY `posts_user_id_idx` (`id`) USING BTREE,
CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Posts table'
```

Expand Down
2 changes: 1 addition & 1 deletion sample/svg/user_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CREATE TABLE `user_options` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`user_id`),
CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='User options table'
```

Expand Down
12 changes: 6 additions & 6 deletions testdata/my.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE TABLE user_options (
show_email boolean NOT NULL DEFAULT false,
created timestamp NOT NULL,
updated timestamp,
CONSTRAINT user_options_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE
CONSTRAINT user_options_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO ACTION ON DELETE CASCADE
) COMMENT = 'User options table';

CREATE TABLE posts (
Expand All @@ -35,7 +35,7 @@ CREATE TABLE posts (
created datetime NOT NULL,
updated datetime,
CONSTRAINT posts_id_pk PRIMARY KEY(id),
CONSTRAINT posts_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE,
CONSTRAINT posts_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO ACTION ON DELETE CASCADE,
UNIQUE(user_id, title)
) COMMENT = 'Posts table';
CREATE INDEX posts_user_id_idx ON posts(id) USING BTREE;
Expand All @@ -48,8 +48,8 @@ CREATE TABLE comments (
created datetime NOT NULL,
updated datetime,
CONSTRAINT comments_id_pk PRIMARY KEY(id),
CONSTRAINT comments_post_id_fk FOREIGN KEY(post_id) REFERENCES posts(id) MATCH SIMPLE,
CONSTRAINT comments_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH SIMPLE,
CONSTRAINT comments_post_id_fk FOREIGN KEY(post_id) REFERENCES posts(id),
CONSTRAINT comments_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id),
UNIQUE(post_id, user_id)
) COMMENT = 'Comments\nMulti-line\r\ntable\rcomment';
CREATE INDEX comments_post_id_user_id_idx ON comments(post_id, user_id) USING HASH;
Expand All @@ -62,8 +62,8 @@ CREATE TABLE comment_stars (
created timestamp NOT NULL,
updated timestamp,
CONSTRAINT comment_stars_id_pk PRIMARY KEY(id),
CONSTRAINT comment_stars_user_id_post_id_fk FOREIGN KEY(comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) MATCH SIMPLE,
CONSTRAINT comment_stars_user_id_fk FOREIGN KEY(comment_user_id) REFERENCES users(id) MATCH SIMPLE,
CONSTRAINT comment_stars_user_id_post_id_fk FOREIGN KEY(comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id),
CONSTRAINT comment_stars_user_id_fk FOREIGN KEY(comment_user_id) REFERENCES users(id),
UNIQUE(user_id, comment_post_id, comment_user_id)
);

Expand Down