for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Files_antivirus
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
* @author Viktar Dubiniuk <[email protected]>
* @copyright Viktar Dubiniuk 2018
* @license AGPL-3.0
*/
namespace OCA\Files_Antivirus\Migrations;
use Doctrine\DBAL\Schema\Schema;
use OCP\Migration\ISchemaMigration;
* Creates initial schema
class Version20170808220321 implements ISchemaMigration {
* @param Schema $schema
* @param array $options
* @return void
public function changeSchema(Schema $schema, array $options) {
$prefix = $options['tablePrefix'];
if (!$schema->hasTable("{$prefix}files_antivirus")) {
$table = $schema->createTable("{$prefix}files_antivirus");
$table->addColumn(
'fileid',
'bigint',
[
'unsigned' => true,
'notnull' => true,
'length' => 11,
]
);
'check_time',
'integer',
'default' => 0,
$table->setPrimaryKey(['fileid']);
}
if (!$schema->hasTable("{$prefix}files_avir_status")) {
$table = $schema->createTable("{$prefix}files_avir_status");
'id',
'autoincrement' => true,
'group_id',
'status_type',
'result',
'unsigned' => false,
'match',
'string',
'length' => 64,
'notnull' => false,
'default' => null,
'description',
'status',
'length' => 4,
$table->setPrimaryKey(['id']);