API updadte
This commit is contained in:
57
Dockerfile
57
Dockerfile
@@ -1,46 +1,57 @@
|
|||||||
|
# Production-ready Symfony Dockerfile
|
||||||
FROM php:8.4-apache
|
FROM php:8.4-apache
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libonig-dev \
|
libonig-dev \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
zip \
|
|
||||||
unzip \
|
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
git \
|
||||||
|
curl \
|
||||||
|
unzip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install PHP extensions for Symfony
|
# Install PHP extensions needed by Symfony
|
||||||
RUN docker-php-ext-configure intl \
|
RUN docker-php-ext-configure intl \
|
||||||
&& docker-php-ext-install pdo_mysql mysqli mbstring exif pcntl bcmath gd zip intl opcache
|
&& docker-php-ext-install -j$(nproc) \
|
||||||
|
pdo_mysql \
|
||||||
|
mbstring \
|
||||||
|
exif \
|
||||||
|
pcntl \
|
||||||
|
bcmath \
|
||||||
|
gd \
|
||||||
|
zip \
|
||||||
|
intl \
|
||||||
|
opcache
|
||||||
|
|
||||||
# Configure opcache for Symfony
|
# Enable Apache modules
|
||||||
RUN echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
|
RUN a2enmod rewrite headers
|
||||||
&& echo "opcache.memory_consumption=256" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
|
|
||||||
&& echo "opcache.max_accelerated_files=20000" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
|
|
||||||
&& echo "opcache.validate_timestamps=0" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
|
|
||||||
|
|
||||||
# Enable Apache mod_rewrite
|
# Copy Apache configuration
|
||||||
RUN a2enmod rewrite
|
|
||||||
|
|
||||||
# Enable Apache headers module
|
|
||||||
RUN a2enmod headers
|
|
||||||
|
|
||||||
# Copy custom Apache configuration
|
|
||||||
COPY ./docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
COPY ./docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
# Install Composer
|
# Copy Composer from official image
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
# Change ownership
|
# Copy Symfony app
|
||||||
|
COPY . /var/www/html
|
||||||
|
|
||||||
|
# Optimize permissions
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
|
# Configure opcache for production
|
||||||
|
RUN { \
|
||||||
|
echo "opcache.enable=1"; \
|
||||||
|
echo "opcache.memory_consumption=256"; \
|
||||||
|
echo "opcache.max_accelerated_files=20000"; \
|
||||||
|
echo "opcache.validate_timestamps=0"; \
|
||||||
|
} > /usr/local/etc/php/conf.d/opcache.ini
|
||||||
|
|
||||||
# Expose port 80
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ api_platform:
|
|||||||
formats:
|
formats:
|
||||||
jsonld: ['application/ld+json']
|
jsonld: ['application/ld+json']
|
||||||
json: ['application/json']
|
json: ['application/json']
|
||||||
html: ['text/html']
|
|
||||||
docs_formats:
|
docs_formats:
|
||||||
jsonld: ['application/ld+json']
|
jsonld: ['application/ld+json']
|
||||||
jsonopenapi: ['application/vnd.openapi+json']
|
jsonopenapi: ['application/vnd.openapi+json']
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251108171050 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, role VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_1483A5E9E7927C74 (email), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE users');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251108172941 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE immobilien (id INT AUTO_INCREMENT NOT NULL, adresse VARCHAR(255) NOT NULL, preis NUMERIC(10, 2) NOT NULL, flaeche NUMERIC(8, 2) NOT NULL, garage TINYINT(1) NOT NULL, zimmer INT NOT NULL, baujahr INT DEFAULT NULL, typ VARCHAR(255) NOT NULL, beschreibung LONGTEXT DEFAULT NULL, verfuegbar TINYINT(1) NOT NULL, balkon_flaeche INT DEFAULT NULL, keller_flaeche INT DEFAULT NULL, etage INT DEFAULT NULL, heizungstyp VARCHAR(100) DEFAULT NULL, nebenkosten NUMERIC(6, 2) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE immobilien');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251108175151 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
// First add the column as nullable
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD verwalter_id INT DEFAULT NULL');
|
|
||||||
|
|
||||||
// Assign all existing immobilien to the first user
|
|
||||||
$this->addSql('UPDATE immobilien SET verwalter_id = (SELECT id FROM users ORDER BY id LIMIT 1)');
|
|
||||||
|
|
||||||
// Now make it NOT NULL and add constraints
|
|
||||||
$this->addSql('ALTER TABLE immobilien MODIFY verwalter_id INT NOT NULL');
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD CONSTRAINT FK_2C789D3E5F66D3 FOREIGN KEY (verwalter_id) REFERENCES users (id)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_2C789D3E5F66D3 ON immobilien (verwalter_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE immobilien DROP FOREIGN KEY FK_2C789D3E5F66D3');
|
|
||||||
$this->addSql('DROP INDEX IDX_2C789D3E5F66D3 ON immobilien');
|
|
||||||
$this->addSql('ALTER TABLE immobilien DROP verwalter_id');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251108213222 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD abschreibungszeit INT DEFAULT NULL, ADD bundesland VARCHAR(255) DEFAULT NULL, ADD kaufpreis INT DEFAULT NULL, DROP balkon_flaeche, DROP keller_flaeche, CHANGE preis preis INT NOT NULL, CHANGE heizungstyp heizungstyp VARCHAR(255) DEFAULT NULL');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD balkon_flaeche INT DEFAULT NULL, ADD keller_flaeche INT DEFAULT NULL, DROP abschreibungszeit, DROP bundesland, DROP kaufpreis, CHANGE preis preis NUMERIC(10, 2) NOT NULL, CHANGE heizungstyp heizungstyp VARCHAR(100) DEFAULT NULL');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251108214500 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE bundeslaender (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(100) NOT NULL, grunderwerbsteuer NUMERIC(4, 2) NOT NULL, UNIQUE INDEX UNIQ_DF7DFAB25E237E06 (name), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
|
|
||||||
$this->addSql('CREATE TABLE heizungstypen (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_6161C2A65E237E06 (name), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD nutzflaeche INT NOT NULL, ADD heizungstyp_id INT DEFAULT NULL, ADD bundesland_id INT DEFAULT NULL, DROP flaeche, DROP verfuegbar, DROP heizungstyp, DROP nebenkosten, DROP bundesland, CHANGE preis wohnflaeche INT NOT NULL');
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD CONSTRAINT FK_2C789DC1B4DB52 FOREIGN KEY (heizungstyp_id) REFERENCES heizungstypen (id)');
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD CONSTRAINT FK_2C789DB74FDBEB FOREIGN KEY (bundesland_id) REFERENCES bundeslaender (id)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_2C789DC1B4DB52 ON immobilien (heizungstyp_id)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_2C789DB74FDBEB ON immobilien (bundesland_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE bundeslaender');
|
|
||||||
$this->addSql('DROP TABLE heizungstypen');
|
|
||||||
$this->addSql('ALTER TABLE immobilien DROP FOREIGN KEY FK_2C789DC1B4DB52');
|
|
||||||
$this->addSql('ALTER TABLE immobilien DROP FOREIGN KEY FK_2C789DB74FDBEB');
|
|
||||||
$this->addSql('DROP INDEX IDX_2C789DC1B4DB52 ON immobilien');
|
|
||||||
$this->addSql('DROP INDEX IDX_2C789DB74FDBEB ON immobilien');
|
|
||||||
$this->addSql('ALTER TABLE immobilien ADD preis INT NOT NULL, ADD flaeche NUMERIC(8, 2) NOT NULL, ADD verfuegbar TINYINT(1) NOT NULL, ADD heizungstyp VARCHAR(255) DEFAULT NULL, ADD nebenkosten NUMERIC(6, 2) DEFAULT NULL, ADD bundesland VARCHAR(255) DEFAULT NULL, DROP wohnflaeche, DROP nutzflaeche, DROP heizungstyp_id, DROP bundesland_id');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251108215623 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE users ADD api_key VARCHAR(64) NOT NULL');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1483A5E9C912ED9D ON users (api_key)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX UNIQ_1483A5E9C912ED9D ON users');
|
|
||||||
$this->addSql('ALTER TABLE users DROP api_key');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
120
migrations/Version20251109100000.php
Normal file
120
migrations/Version20251109100000.php
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initial migration: Creates all tables and populates reference data
|
||||||
|
*/
|
||||||
|
final class Version20251109100000 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Initial database schema with all tables and reference data';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// Create users table
|
||||||
|
$this->addSql('CREATE TABLE users (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL,
|
||||||
|
name VARCHAR(255) NOT NULL,
|
||||||
|
email VARCHAR(255) NOT NULL,
|
||||||
|
role VARCHAR(255) NOT NULL,
|
||||||
|
created_at DATETIME NOT NULL,
|
||||||
|
api_key VARCHAR(64) NOT NULL,
|
||||||
|
UNIQUE INDEX UNIQ_1483A5E9E7927C74 (email),
|
||||||
|
UNIQUE INDEX UNIQ_1483A5E9C912ED9D (api_key),
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||||
|
|
||||||
|
// Create bundeslaender table
|
||||||
|
$this->addSql('CREATE TABLE bundeslaender (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL,
|
||||||
|
name VARCHAR(100) NOT NULL,
|
||||||
|
grunderwerbsteuer NUMERIC(4, 2) NOT NULL,
|
||||||
|
UNIQUE INDEX UNIQ_DF7DFAB25E237E06 (name),
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||||
|
|
||||||
|
// Create heizungstypen table
|
||||||
|
$this->addSql('CREATE TABLE heizungstypen (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL,
|
||||||
|
name VARCHAR(100) NOT NULL,
|
||||||
|
UNIQUE INDEX UNIQ_6161C2A65E237E06 (name),
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||||
|
|
||||||
|
// Create immobilien table
|
||||||
|
$this->addSql('CREATE TABLE immobilien (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL,
|
||||||
|
verwalter_id INT NOT NULL,
|
||||||
|
heizungstyp_id INT DEFAULT NULL,
|
||||||
|
bundesland_id INT DEFAULT NULL,
|
||||||
|
adresse VARCHAR(255) NOT NULL,
|
||||||
|
wohnflaeche INT NOT NULL,
|
||||||
|
nutzflaeche INT NOT NULL,
|
||||||
|
garage TINYINT(1) NOT NULL,
|
||||||
|
zimmer INT NOT NULL,
|
||||||
|
baujahr INT DEFAULT NULL,
|
||||||
|
typ VARCHAR(255) NOT NULL,
|
||||||
|
beschreibung LONGTEXT DEFAULT NULL,
|
||||||
|
etage INT DEFAULT NULL,
|
||||||
|
kaufpreis INT DEFAULT NULL,
|
||||||
|
abschreibungszeit INT DEFAULT NULL,
|
||||||
|
created_at DATETIME NOT NULL,
|
||||||
|
updated_at DATETIME NOT NULL,
|
||||||
|
INDEX IDX_2C789D3E5F66D3 (verwalter_id),
|
||||||
|
INDEX IDX_2C789DC1B4DB52 (heizungstyp_id),
|
||||||
|
INDEX IDX_2C789DB74FDBEB (bundesland_id),
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
|
||||||
|
|
||||||
|
// Add foreign keys
|
||||||
|
$this->addSql('ALTER TABLE immobilien ADD CONSTRAINT FK_2C789D3E5F66D3 FOREIGN KEY (verwalter_id) REFERENCES users (id)');
|
||||||
|
$this->addSql('ALTER TABLE immobilien ADD CONSTRAINT FK_2C789DC1B4DB52 FOREIGN KEY (heizungstyp_id) REFERENCES heizungstypen (id)');
|
||||||
|
$this->addSql('ALTER TABLE immobilien ADD CONSTRAINT FK_2C789DB74FDBEB FOREIGN KEY (bundesland_id) REFERENCES bundeslaender (id)');
|
||||||
|
|
||||||
|
// Populate Bundesländer with Grunderwerbsteuer rates
|
||||||
|
$this->addSql("INSERT INTO bundeslaender (name, grunderwerbsteuer) VALUES
|
||||||
|
('Baden-Württemberg', 5.00),
|
||||||
|
('Bayern', 3.50),
|
||||||
|
('Berlin', 6.00),
|
||||||
|
('Brandenburg', 6.50),
|
||||||
|
('Bremen', 5.00),
|
||||||
|
('Hamburg', 5.50),
|
||||||
|
('Hessen', 6.00),
|
||||||
|
('Mecklenburg-Vorpommern', 6.00),
|
||||||
|
('Niedersachsen', 5.00),
|
||||||
|
('Nordrhein-Westfalen', 6.50),
|
||||||
|
('Rheinland-Pfalz', 5.00),
|
||||||
|
('Saarland', 6.50),
|
||||||
|
('Sachsen', 5.50),
|
||||||
|
('Sachsen-Anhalt', 5.00),
|
||||||
|
('Schleswig-Holstein', 6.50),
|
||||||
|
('Thüringen', 5.00)");
|
||||||
|
|
||||||
|
// Populate Heizungstypen
|
||||||
|
$this->addSql("INSERT INTO heizungstypen (name) VALUES
|
||||||
|
('Ölheizung'),
|
||||||
|
('Gasheizung'),
|
||||||
|
('Wärmepumpe'),
|
||||||
|
('Pelletheizung')");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// Drop all tables
|
||||||
|
$this->addSql('ALTER TABLE immobilien DROP FOREIGN KEY FK_2C789D3E5F66D3');
|
||||||
|
$this->addSql('ALTER TABLE immobilien DROP FOREIGN KEY FK_2C789DC1B4DB52');
|
||||||
|
$this->addSql('ALTER TABLE immobilien DROP FOREIGN KEY FK_2C789DB74FDBEB');
|
||||||
|
$this->addSql('DROP TABLE immobilien');
|
||||||
|
$this->addSql('DROP TABLE bundeslaender');
|
||||||
|
$this->addSql('DROP TABLE heizungstypen');
|
||||||
|
$this->addSql('DROP TABLE users');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ enum Heizungstyp: string
|
|||||||
case GASHEIZUNG = 'gasheizung';
|
case GASHEIZUNG = 'gasheizung';
|
||||||
case WAERMEPUMPE = 'waermepumpe';
|
case WAERMEPUMPE = 'waermepumpe';
|
||||||
case OELHEIZUNG = 'oelheizung';
|
case OELHEIZUNG = 'oelheizung';
|
||||||
|
case PELLETHEIZUNG = 'pelletheizung';
|
||||||
|
|
||||||
public function getLabel(): string
|
public function getLabel(): string
|
||||||
{
|
{
|
||||||
@@ -14,6 +15,7 @@ enum Heizungstyp: string
|
|||||||
self::GASHEIZUNG => 'Gasheizung',
|
self::GASHEIZUNG => 'Gasheizung',
|
||||||
self::WAERMEPUMPE => 'Wärmepumpe',
|
self::WAERMEPUMPE => 'Wärmepumpe',
|
||||||
self::OELHEIZUNG => 'Ölheizung',
|
self::OELHEIZUNG => 'Ölheizung',
|
||||||
|
self::PELLETHEIZUNG => 'Pelletheizung',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user