
CREATE TABLE IF NOT EXISTS permissions (
  id INT AUTO_INCREMENT PRIMARY KEY,
  code VARCHAR(120) UNIQUE NOT NULL,
  name VARCHAR(180) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS role_permissions (
  role_code VARCHAR(40) NOT NULL,
  perm_code VARCHAR(120) NOT NULL,
  PRIMARY KEY(role_code, perm_code)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
