events yogibook

This commit is contained in:
2026-09-17 10:22:30 +02:00
parent 434eb8bc48
commit 5df1f2d261
26 changed files with 4394 additions and 30 deletions
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateEventLocationsTable extends AbstractMigration
{
public function change(): void
{
$table = $this->table('event_locations', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
]);
$table
->addColumn('id', 'biginteger', ['identity' => true, 'signed' => false])
->addColumn('name', 'string', ['limit' => 191, 'null' => false, 'comment' => 'etichetta sede, es. "Studio YogaSoul"'])
->addColumn('address', 'string', ['limit' => 255, 'null' => false])
->addColumn('lat', 'decimal', ['precision' => 10, 'scale' => 7, 'null' => true])
->addColumn('lng', 'decimal', ['precision' => 10, 'scale' => 7, 'null' => true])
->addColumn('is_default', 'char', ['limit' => 1, 'null' => false, 'default' => 'N', 'comment' => 'Y = preselezionata'])
->addColumn('created_at', 'timestamp', ['null' => true, 'default' => null])
->addColumn('updated_at', 'timestamp', ['null' => true, 'default' => null])
->addIndex(['is_default'], ['name' => 'event_locations_is_default_index'])
->create();
// Sede di default (MODIFICA con indirizzo e coordinate reali della scuola)
$this->table('event_locations')->insert([
'name' => 'Studio YogaSoul',
'address' => 'Indirizzo da compilare',
'lat' => null,
'lng' => null,
'is_default' => 'Y',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
])->saveData();
}
}