Does the following mean that both columns or the combination of columns needs to be unique?

public function defineIndexes()
    return [
        ['columns' => ['productId', 'productTypeId'], 'unique' => true],

1 Answer 1


It means that no combination of those two columns can be the same in the table stated in the getTableName() of your record.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.