Recommend this syntax:

    [
        [ 'type' => 'unique', 'field' => 'username' ],
        [ 'type' => 'unique', 'field' => 'email' ],
        [ 'type' => 'primary', 'field' => 'id' ],
    ]

Then for multicolumn indices you can do, for example:

    [
        [ 'type' => 'unique', 'field' => [ 'username', 'password' ] ],
        [ 'type' => 'unique', 'field' => 'email' ],
        [ 'type' => 'primary', 'field' => 'id' ],
    ]