CREATE TABLE function_index_test (
   id INT AUTO_INCREMENT PRIMARY KEY,
   owner_id INT NOT NULL,
   code VARCHAR(100) NOT NULL,
   UNIQUE KEY uk_owner_id_upper_code (owner_id, (upper(code)))
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE function_index_test2 (
     id INT AUTO_INCREMENT PRIMARY KEY,
     owner_id INT NOT NULL,
     code VARCHAR(100) NOT NULL,
     UNIQUE KEY uk_owner_id_upper_code (owner_id, ((LEFT(UPPER(code), 10))))
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE function_index_test3 (
      id INT AUTO_INCREMENT PRIMARY KEY,
      owner_id INT NOT NULL,
      code VARCHAR(100) NOT NULL,
      UNIQUE KEY uk_owner_id_upper_code (owner_id , code(10))
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE function_index_test3 (
      id INT AUTO_INCREMENT PRIMARY KEY,
      owner_id INT NOT NULL,
      code VARCHAR(100) NOT NULL,
      UNIQUE KEY uk_owner_id_upper_code (code(10))
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
