Guest User

Untitled

a guest
Jan 14th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Create table posts (
  2. post_id Int(10) NOT NULL AUTO_INCREMENT,
  3. author_id Char(36) NOT NULL,
  4. Primary Key (post_id)) ENGINE = InnoDB;
  5.  
  6. Create table users (
  7. id Char(36) NOT NULL,
  8. username Varchar(16),
  9. Primary Key (id)) ENGINE = InnoDB;
  10.  
  11. Alter table posts add Constraint rel_post_author Foreign Key (author_id) references users (id) on delete restrict on update restrict;
Add Comment
Please, Sign In to add comment