Files
points-of-interest/server/migrations/Version20240919000000.php
T
2025-10-10 08:48:27 +02:00

29 lines
850 B
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240919000000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create signals table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE signals (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_key VARCHAR(64) NOT NULL, lat DOUBLE PRECISION NOT NULL, lng DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL)');
$this->addSql('CREATE INDEX idx_signals_created_at ON signals (created_at)');
$this->addSql('CREATE INDEX idx_signals_user_key ON signals (user_key)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE signals');
}
}