Advertisement
Guest User

Untitled

a guest
May 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. CREATE TABLE `party` (
  2. id BIGINT UNSIGNED auto_increment PRIMARY KEY,
  3. name VARCHAR(40) UNIQUE NOT NULL
  4. );
  5.  
  6. CREATE TABLE `character` (
  7. id BIGINT UNSIGNED auto_increment PRIMARY KEY,
  8. name VARCHAR(40) NOT NULL
  9. );
  10.  
  11. CREATE TABLE `class` (
  12. id BIGINT UNSIGNED auto_increment PRIMARY KEY,
  13. name VARCHAR(20) NOT NULL
  14. );
  15.  
  16. CREATE TABLE `makeup` (
  17. id BIGINT UNSIGNED auto_increment PRIMARY KEY,
  18. party BIGINT UNSIGNED NOT NULL,
  19. class BIGINT UNSIGNED NOT NULL,
  20. FOREIGN KEY (party) REFERENCES `party`(id),
  21. FOREIGN KEY (class) REFERENCES `class`(id)
  22. );
  23.  
  24. CREATE TABLE `characterclass` (
  25. id BIGINT UNSIGNED auto_increment PRIMARY KEY,
  26. `character` BIGINT UNSIGNED NOT NULL,
  27. class BIGINT UNSIGNED NOT NULL,
  28. FOREIGN KEY (`character`) REFERENCES `character`(id),
  29. FOREIGN KEY (class) REFERENCES `class`(id)
  30. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement