 ) ENGINE = INNODB;
 
 CREATE TABLE IF NOT EXISTS cockpit_user_role_xref (
-  user_id INT NOT NULL REFERENCES cockpit_user(id),
-  role_id INT NOT NULL REFERENCES cockpit_role(id),
+  user_id INT NOT NULL REFERENCES cockpit_user(id) ON DELETE RESTRICT ,
+  role_id INT NOT NULL REFERENCES cockpit_role(id) ON DELETE RESTRICT ,
   CONSTRAINT UNIQUE (user_id, role_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)
);



  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;
