Skip to content

Instantly share code, notes, and snippets.

@trimoq
Created October 21, 2019 10:42
Show Gist options
  • Save trimoq/f4306e35d00a5e3542231c02ebbd1f42 to your computer and use it in GitHub Desktop.
Save trimoq/f4306e35d00a5e3542231c02ebbd1f42 to your computer and use it in GitHub Desktop.
CREATE TABLE drive (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES apiuser(id) ON DELETE CASCADE,
travel_date DATE NOT NULL,
start_loc VARCHAR NOT NULL,
end_loc VARCHAR NOT NULL,
distance INTEGER NOT NULL,
UNIQUE(user_id,travel_date)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment