create table collections( id serial primary key not null, location_id int, private int, updated_on timestamp, created_on timestamp ); create table tags( id serial primary key not null, parent_id int, name varchar, created_on timestamp ); create table collections_tags( collection_id int, tags_id int );