hasTable('weather_city')) { $table = $schema->createTable('weather_city'); $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, 'length' => 10, ]); $table->addColumn('name', 'string', [ 'notnull' => true, 'length' => 255, ]); $table->addColumn('user_id', 'string', [ 'notnull' => true, 'length' => 255, ]); $table->setPrimaryKey(['id']); } if (!$schema->hasTable('weather_config')) { $table = $schema->createTable('weather_config'); $table->addColumn('user', 'string', [ 'notnull' => true, 'length' => 255, ]); $table->addColumn('key', 'string', [ 'notnull' => true, 'length' => 255, ]); $table->addColumn('value', 'string', [ 'notnull' => false, 'length' => 10240, ]); } return $schema; } /** * @param IOutput $output * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options */ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { } }