CREATE TABLE networks (
  id TEXT PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  admin_email VARCHAR(255) NOT NULL,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE network_members (
  network_id TEXT NOT NULL REFERENCES networks(id) ON DELETE CASCADE,
  email VARCHAR(255) NOT NULL,
  joined_at TIMESTAMPTZ DEFAULT NOW(),
  PRIMARY KEY (network_id, email)
);
