hasTable('files_versions')) { return null; } $table = $schema->createTable('files_versions'); $table->addColumn('id', Types::BIGINT, [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, ]); $table->addColumn('file_id', Types::BIGINT, [ 'notnull' => true, 'length' => 20, ]); $table->addColumn('timestamp', Types::BIGINT, [ 'notnull' => true, 'length' => 20, ]); $table->addColumn('size', Types::BIGINT, [ 'notnull' => true, 'length' => 20, ]); $table->addColumn('mimetype', Types::BIGINT, [ 'notnull' => true, 'length' => 20, ]); $table->addColumn('metadata', Types::JSON, [ 'notnull' => true, ]); $table->setPrimaryKey(['id']); $table->addUniqueIndex(['file_id', 'timestamp'], 'files_versions_uniq_index'); return $schema; } }