Advertisement
dachte

treysql

Aug 29th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE ingredient (
  2.   id SERIAL PRIMARY KEY,
  3.   name TEXT NOT NULL UNIQUE
  4. );
  5.  
  6. CREATE TABLE recipe (
  7.   id SERIAL PRIMARY KEY,
  8.   name TEXT NOT NULL UNIQUE
  9. );
  10.  
  11. CREATE TABLE component (
  12.   recipeid INTEGER REFERENCES recipe(id),
  13.   ingredientid INTEGER REFERENCES ingredient(id),
  14.   count INTEGER NOT NULL DEFAULT 1
  15. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement