hasTable('group_folders_versions')) { return null; } $table = $schema->createTable('group_folders_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::TEXT, [ 'notnull' => true, 'default' => '{}', ]); $table->setPrimaryKey(['id']); $table->addUniqueIndex(['file_id', 'timestamp'], 'gf_versions_uniq_index'); return $schema; } }