I am trying to create a pivot table with the rainlab builder plugin for a $belongsToMany relation of a company id to a category id but getting following error and have found no solution for it yet
SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'namespaceauthor_directory_company_category_pivot_company_id_category_id_primary' is too long (SQL: alter table `namespaceauthor_directory_company_category_pivot` add primary key `namespaceauthor_directory_company_category_pivot_company_id_category_id_primary`(`company_id`, `category_id`))
public function up()
{
Schema::create('namespaceauthor_directory_company_category_pivot', function($table)
{
$table->engine = 'InnoDB';
$table->integer('company_id');
$table->integer('category_id');
$table->primary(['company_id','category_id']);
});
}
public function down()
{
Schema::dropIfExists('namespaceauthor_directory_company_category_pivot');
}
Thank you in advance for any help