users_homes.sql 311 B

123456789
  1. CREATE TABLE IF NOT EXISTS users_homes (
  2. user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  3. home_id UUID NOT NULL REFERENCES homes(id) ON DELETE CASCADE,
  4. is_admin BOOLEAN DEFAULT false,
  5. created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
  6. PRIMARY KEY (user_id, home_id)
  7. )