I have an application that is written in Laravel. The problem I am facing is that there is another application instance that uses the same information from a different database schema. The idea is to use Laravel's database schema with a new Symfony instance but I am running into an issue that I cannot seem to find a solution for.
Below is a schema of a typical table that exists on laravel's application instance:
CREATE TABLE IF NOT EXISTS `table_name` (
`id` varchar(255) NOT NULL,
`payload` text NOT NULL,
`last_activity` int(11) NOT NULL,
UNIQUE KEY `sessions_id_unique` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
This table has no primary key recorded into it which I would like to believe Laravel is forgiving when it comes to that. However, Doctrine2, as it seems, does not support reverse engineering on database tables that have no primary key and therefore I cannot create entities from this database due to that.
Is there any hack I can apply to bypass this error as I have hundreds of tables in this database to create my entities manually?
Below is the exception I get from the command line:
[Doctrine\ORM\Mapping\MappingException] Table maw_sessions has no primary key. Doctrine does not support reverse engineering from tables that don't have a primary key.