As a user ,
so that I can keep a track of my favourite website,
I'd like to see a list of bookmarks
As a user,
so that I can store my bookmarks,
I'd like to be able to add bookmarks
As a user,
so that I can delete my bookmarks,
I'd like to be able to remove bookmarks
As a user,
so that I can update my bookmarks,
I'd like to be able to update bookmarks
As a user,
so that I can add notes to my bookmarks,
I'd like to be able to add comments to bookmarks
As a user,
so that I can categorize my bookmarks,
I'd like to be able to add tags to bookmarks
CREATE DATABASE bookmark_manager;
\c bookmark_manager;
CREATE TABLE bookmarks(id SERIAL PRIMARY KEY, title VARCHAR(20), url VARCHAR(60));)
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
text VARCHAR(240),
bookmark_id integer REFERENCES bookmarks(id)
);
CREATE TABLE tags (
id SERIAL PRIMARY KEY,
content VARCHAR(60)
);
CREATE TABLE bookmarks_tags (
id SERIAL PRIMARY KEY,
bookmark_id integer REFERENCES bookmarks(id),
tag_id integer REFERENCES tags(id)
);
CREATE DATABASE bookmark_manager_test;
\c bookmark_manager_test;
CREATE TABLE bookmarks(id SERIAL PRIMARY KEY, title VARCHAR(20), url VARCHAR(60));)
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
text VARCHAR(240),
bookmark_id integer REFERENCES bookmarks(id)
);
CREATE TABLE tags (
id SERIAL PRIMARY KEY,
content VARCHAR(60)
);