Merge pull request #3426 from wallabag/fix-migration-3373

Fix MySQL issue on mig from #3373
This commit is contained in:
Nicolas Lœuillet
2017-11-21 11:03:39 +01:00
committed by GitHub
4 changed files with 4 additions and 3 deletions

View File

@ -31,6 +31,7 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI
switch ($this->connection->getDatabasePlatform()->getName()) { switch ($this->connection->getDatabasePlatform()->getName()) {
case 'mysql': case 'mysql':
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;'); $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
break; break;
case 'postgresql': case 'postgresql':

View File

@ -983,7 +983,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertSame(false, $content['exists']); $this->assertFalse($content['exists']);
} }
public function testGetEntriesExistsWithNoUrl() public function testGetEntriesExistsWithNoUrl()

View File

@ -68,7 +68,7 @@ class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase
$config = $this->builder->buildForHost('www.example.com'); $config = $this->builder->buildForHost('www.example.com');
$this->assertSame('example.com', $config->getHost()); $this->assertSame('example.com', $config->getHost());
$this->assertSame(true, $config->requiresLogin()); $this->assertTrue($config->requiresLogin());
$this->assertSame('http://www.example.com/login', $config->getLoginUri()); $this->assertSame('http://www.example.com/login', $config->getLoginUri());
$this->assertSame('login', $config->getUsernameField()); $this->assertSame('login', $config->getUsernameField());
$this->assertSame('password', $config->getPasswordField()); $this->assertSame('password', $config->getPasswordField());

View File

@ -51,7 +51,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$this->assertEmpty($entry->getMimetype()); $this->assertEmpty($entry->getMimetype());
$this->assertEmpty($entry->getLanguage()); $this->assertEmpty($entry->getLanguage());
$this->assertSame(0.0, $entry->getReadingTime()); $this->assertSame(0.0, $entry->getReadingTime());
$this->assertSame(null, $entry->getDomainName()); $this->assertNull($entry->getDomainName());
} }
public function testWithEmptyContent() public function testWithEmptyContent()