   name text NOT NULL
 ) WITH (OIDS=FALSE);
 
-CREATE TABLE IF NOT EXISTS projects_share (
-  project uuid PRIMARY KEY REFERENCES projects(id),
+CREATE TABLE IF NOT EXISTS project_shares (
+  id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
+  project uuid REFERENCES projects(id),
   created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
   modified_at timestamptz NOT NULL DEFAULT clock_timestamp(),
   token text

 BEFORE UPDATE ON projects
  FOR EACH ROW EXECUTE PROCEDURE update_modified_at();

CREATE TRIGGER projects_share_modified_at_tgr
 BEFORE UPDATE ON projects_share
  FOR EACH ROW EXECUTE PROCEDURE update_modified_at();

-- Indexes


CREATE INDEX projects_user_idx
    ON projects("user");

CREATE UNIQUE INDEX projects_shares_token_idx
    ON project_shares(token);
