<commit_before><?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Initial database structure.
 */
class Version20160401000000 extends AbstractMigration implements ContainerAwareInterface
{
    /**
     * @var ContainerInterface
     */
    private $container;

    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        try {
            $schema->getTable($this->getTable('entry'));

            $this->skipIf(true, 'Database already initialized');
        } catch (SchemaException $e) {
            // it's ok, the table does not exist we can proceed to the initial migration
        }

        switch ($this->connection->getDatabasePlatform()->getName()) {<commit_msg>Use hasTable instead of try/catch<commit_after><?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Initial database structure.
 */
class Version20160401000000 extends AbstractMigration implements ContainerAwareInterface
{
    /**
     * @var ContainerInterface
     */
    private $container;

    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        $this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');

        switch ($this->connection->getDatabasePlatform()->getName()) {
{'fraction_non_alphanumeric': 0.10890104425658877, 'fraction_numerical': 0.0139234211834908, 'mean_word_length': 3.6252873563218393, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4662183', 'n_tokens_mistral': 545, 'n_tokens_neox': 522, 'n_words': 115}