How to add a foreign key during migrations? Used by DoctrineMigrationsBundle
There is a house table:
And the user table:
+ migration code
public function up(Schema $schema) { $houseTable = $schema->getTable('house'); $table = $schema->createTable('user'); $table->addColumn('id', 'integer', ['autoincrement' => true, 'unsigned' => true]); $table->setPrimaryKey(['id']); $table->addColumn('first_name', 'string', ['length' => 255]); $table->addColumn('last_name', 'string', ['length' => 255]); $table->addColumn('password', 'string', ['length' => 255]); $table->addColumn('slat', 'string', ['length' => 255]); $table->addColumn('email', 'string', ['length' => 255]); $table->addColumn('created', 'datetime'); $table->addColumn('updated', 'datetime'); } I need to organize one-to-many communication (the user has a lot of housov). How to do it?

