CREATE TABLE "users" (
  user_id   uuid     NOT NULL PRIMARY KEY,
  email     text     UNIQUE,
  password  text     NOT NULL,
  admin     boolean  NOT NULL
);

CREATE TABLE IF NOT EXISTS users_members (
  user_id   uuid        NOT NULL REFERENCES users (user_id) ON UPDATE cascade ON DELETE cascade,
  member_id varchar(7)  NOT NULL REFERENCES members (member_id) ON UPDATE cascade ON DELETE cascade,

  CONSTRAINT users_members_pkey PRIMARY KEY (user_id, member_id)
);
