   username VARCHAR(32) NOT NULL ,
   password  VARCHAR(64) NOT NULL,
   email VARCHAR(255) NOT NULL ,
-  status_id INT NOT NULL REFERENCES status_lu(id)
+  status_id INT NOT NULL REFERENCES status_lu(id) ON DELETE RESTRICT
 ) ENGINE = INNODB;
 
 CREATE TABLE IF NOT EXISTS team_user_xref (
-  team_id INT NOT NULL REFERENCES team(id),
-  user_id INT NOT NULL REFERENCES cockpit_user(id),
+  team_id INT NOT NULL REFERENCES team(id) ON DELETE RESTRICT ,
+  user_id INT NOT NULL REFERENCES cockpit_user(id) ON DELETE RESTRICT ,
   CONSTRAINT UNIQUE (team_id, user_id)
 );
 

-- Resource ownership

CREATE TABLE IF NOT EXISTS topic_team_xref(
  topic_id INT NOT NULL REFERENCES topic(id),
  team_id INT NOT NULL REFERENCES team(id),
  CONSTRAINT UNIQUE (topic_id, team_id)
) ENGINE = INNODB;


CREATE TABLE IF NOT EXISTS consumer_group_team_xref(
  consumer_group_id INT NOT NULL REFERENCES consumer_group(id),
  team_id INT NOT NULL REFERENCES team(id),
  CONSTRAINT UNIQUE (consumer_group_id, team_id)
) ENGINE = INNODB;

  name_space VARCHAR(255) NOT NULL,
  `key` VARCHAR(255) NOT NULL,
  `value` VARCHAR(255) NOT NULL,
  status_id INT NOT NULL REFERENCES status_lu(id) ON DELETE RESTRICT
);


