fac19 / Cardley---backend

RESTful api for Cardley
https://cardley-api.herokuapp.com/
0 stars 0 forks source link

Foreign keys #44

Open HettieM opened 4 years ago

HettieM commented 4 years ago

It's a good idea to label fields as foreign keys in your schema - doesn't appear to be entirely necessary, but it's good practice for "referential integrity". e.g. CREATE TBALE decks ( deck_id SERIAL PRIMARY KEY, owner_id INTEGER, deck_name VARCHAR(255) NOT NULL, published BOOLEAN DEFAULT false, FOREIGN KEY (owner_id) REFERENCES users(user_id) )

Roger-Heathcote commented 4 years ago

@HettieM Cool, good to know! Thanks.