daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Jan 14th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
Top