hasTable('f7push_devices')) { $table = $schema->createTable('f7push_devices'); $table->addColumn('id', 'integer', [ 'autoincrement' => true, 'notnull' => true, 'length' => 4, 'unsigned' => true, ]); $table->addColumn('user_id', 'string', [ 'notnull' => true, 'length' => 64, ]); $table->addColumn('device_id', 'string', [ 'notnull' => true, 'length' => 128, ]); $table->addColumn('fcm_token', 'text', [ 'notnull' => true, ]); $table->addColumn('platform', 'string', [ 'notnull' => true, 'length' => 32, 'default' => 'android', ]); $table->addColumn('client_app', 'string', [ 'notnull' => true, 'length' => 64, 'default' => 'f7cloud-apk', ]); $table->addColumn('created_at', 'integer', [ 'notnull' => true, 'unsigned' => true, ]); $table->addColumn('last_seen', 'integer', [ 'notnull' => true, 'unsigned' => true, ]); $table->setPrimaryKey(['id']); $table->addUniqueIndex(['user_id', 'device_id'], 'f7push_dev_user_device'); $table->addIndex(['user_id'], 'f7push_dev_user'); } return $schema; } }