Migriere Persistenz von SQLite zu PostgreSQL (postgresql.lan:5432/essens)

- Dockerfile: pdo_pgsql installieren
- migrations: Postgres-Dialekt (SERIAL, TIMESTAMP(0), TEXT)
- compose/.env(.dist): postgresql://DATABASE_URL (Passwort via .env.local)
- bin/migrate-sqlite-to-pg.sh: einmaliger Datenimport SQLite->PG
This commit is contained in:
2026-09-25 16:52:28 +02:00
parent 4be948557e
commit 76690c919c
7 changed files with 51 additions and 15 deletions
+3 -5
View File
@@ -8,26 +8,24 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
* Postgres-Port der ursprünglichen SQLite-Migration (2026-09-13).
*/
final class Version20260913204759 extends AbstractMigration
{
public function getDescription(): string
{
return '';
return 'essens_user (Postgres)';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE essens_user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, kc_sub VARCHAR(64) NOT NULL, created_am DATETIME NOT NULL, updated_am DATETIME NOT NULL)');
$this->addSql('CREATE TABLE essens_user (id SERIAL PRIMARY KEY, username VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, kc_sub VARCHAR(64) NOT NULL, created_am TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_am TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL)');
$this->addSql('CREATE UNIQUE INDEX uniq_email ON essens_user (email)');
$this->addSql('CREATE UNIQUE INDEX uniq_kc_sub ON essens_user (kc_sub)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE essens_user');
}
}