I have a migration for my tags table like the below:
Schema::create('tags', function (Blueprint $table) {
$table->increments('id');
$table->char('tag' , 15);
});
Now, I have the following migration for my admin
table in which i have a foreign key associated with my tags
table , the migration is the following:
Schema::create('admin', function (Blueprint $table) {
$table->char('tag' , 15);
$table->foreign('tag')->references('tag')->on('tags');
});
Now when i run this migration i get the following error:
Both the tables are innodb
i have changed this in the settings in laravel. But i still get a cannot add a foreign key constraint error. Why ??