I'm new to Phinx can anyone tell me how to create 'myindex' so it is defined as
KEY myindex
(column1
, column2(767)
)
<?php
use Phinx\Migration\AbstractMigration;
class CreateMyTableTable extends AbstractMigration
{
public function change() {
$this->table('my_table')
->addColumn('column1', 'integer')
->addColumn('column2', 'text')
->addIndex(['column1', 'column2'], ['name' => 'myindex'])
->create();
}
}
I want an index that looks like this
CREATE TABLE my_table (
\`id\`int(11) unsigned NOT NULL AUTO_INCREMENT,
\`column1\` int(11) NOT NULL,
\`column2\` text,
PRIMARY KEY (\`id\`),
KEY \`myindex\` (\`column1\`, \`column2(767)\`)
)
Thanks in advance!