fixed pages
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddPropagationTracking extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
// Tabella che raggruppa ogni propagazione
|
||||
$table = $this->table('propagation', ['id' => 'idpropagation']);
|
||||
$table->addColumn('idservice', 'integer')
|
||||
->addColumn('token', 'string', ['limit' => 64])
|
||||
->addColumn('startdate', 'date', ['null' => true])
|
||||
->addColumn('enddate', 'date', ['null' => true])
|
||||
->addColumn('created_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP'])
|
||||
->addIndex(['token'], ['unique' => true])
|
||||
->addIndex(['idservice'])
|
||||
->create();
|
||||
|
||||
// Campo token sulle singole occorrenze del calendario
|
||||
$schedule = $this->table('serviceschedule');
|
||||
if (!$schedule->hasColumn('propagation_token')) {
|
||||
$schedule->addColumn('propagation_token', 'string', ['limit' => 64, 'null' => true])
|
||||
->addIndex(['propagation_token'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class FixPropagationCollation extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$this->execute(
|
||||
"ALTER TABLE propagation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
|
||||
);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
$this->execute(
|
||||
"ALTER TABLE propagation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user