Skip to content

Commit

Permalink
fix: default column values for profile stats table
Browse files Browse the repository at this point in the history
  • Loading branch information
roydejong committed Jan 13, 2024
1 parent 50f1d65 commit 7f94a5f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions migrations/20240113204209_fix_default_values_for_profile_stats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);

use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Migration\AbstractMigration;

final class FixDefaultValuesForProfileStats extends AbstractMigration
{
public function change(): void
{
$this->table('profile_stats')
->changeColumn('hosts', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->changeColumn('joins', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->changeColumn('plays', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->changeColumn('good_cuts', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->changeColumn('bad_cuts', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->changeColumn('miss_count', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->changeColumn('total_score', 'integer', ['signed' => false, 'null' => false, 'length' => MysqlAdapter::INT_BIG, 'default' => 0])
->changeColumn('max_combo', 'integer', ['signed' => false, 'null' => false, 'default' => 0])
->update();
}
}

0 comments on commit 7f94a5f

Please sign in to comment.