   retry_max_times INT NOT NULL DEFAULT 3,
   retry_queue_num MEDIUMINT NOT NULL DEFAULT 3,
   consume_from_min_enable BOOL NOT NULL DEFAULT TRUE,
-  status_id INT NOT NULL DEFAULT 1 REFERENCES status_lu(id),
+  status_id INT NOT NULL DEFAULT 1 REFERENCES status_lu(id) ON DELETE RESTRICT ,
   create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   update_time TIMESTAMP NOT NULL DEFAULT 0
 ) ENGINE = INNODB;

  username VARCHAR(32) NOT NULL ,
  password  VARCHAR(64) NOT NULL,
  email VARCHAR(255) NOT NULL ,
  status_id INT NOT NULL REFERENCES status_lu(id)
) 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),
  CONSTRAINT UNIQUE (team_id, user_id)
);


  has_unit_subscription BOOL NOT NULL DEFAULT FALSE ,
  broker_address VARCHAR(255),
  order_type BOOL DEFAULT FALSE,
  status_id INT NOT NULL DEFAULT 1 REFERENCES status_lu(id) ON DELETE RESTRICT ,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT 0
) ENGINE = INNODB;
