hasTable('agencys')) { $table = $schema->createTable('agencys'); $table->addColumn('id', 'integer', [ 'autoincrement' => true, 'notnull' => true, ]); $table->addColumn('name', 'string', [ 'notnull' => true, 'length' => 200 ]); $table->addColumn('inhaber', 'string', [ 'notnull' => false, 'length' => 200 ]); $table->addColumn('street', 'string', [ 'notnull' => false, 'length' => 200 ]); $table->addColumn('city', 'string', [ 'notnull' => false, 'length' => 200 ]); $table->addColumn('plz', 'string', [ 'notnull' => false, 'length' => 5 ]); $table->addColumn('agency_email', 'string', [ 'notnull' => false, 'length' => 200 ]); $table->addColumn('phone', 'string', [ 'notnull' => false, 'length' => 200 ]); $table->setPrimaryKey(['id']); } if (!$schema->hasTable('agency_user')) { $table = $schema->createTable('agency_user'); $table->addColumn('id', 'integer', [ 'autoincrement' => true, 'notnull' => true, ]); $table->rColumn('agency', 'integer', [ 'notnull' => true, 'length' => 64 ]); $table->rColumn('user', 'integer', [ 'notnull' => true, 'length' => 64 ]); $table->setPrimaryKey(['id']); } return $schema; } }