4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-14 21:26:37 +00:00

Fixed incorrect decimal, should've been 7,2 from the start (#3116)

* Fixed incorrect decimal, should've been 7,2 from the start

* Change return type of getLength() to float to support decimals
This commit is contained in:
Bjarn Bronsveld 2020-08-26 18:36:37 +02:00 committed by GitHub
parent 1b7bd02d54
commit d0ab57a4f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Entity\Migration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200826084718 extends AbstractMigration
{
public function getDescription() : string
{
return 'Fix an oopsie with incorrect decimals.';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE station_media MODIFY `length` NUMERIC(7, 2)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE station_media MODIFY `length` NUMERIC(7, 2)');
}
}

View File

@ -332,7 +332,7 @@ class StationMedia
$this->isrc = $isrc;
}
public function getLength(): int
public function getLength(): float
{
return $this->length;
}