diff --git a/src/Controller/DatabaseConnection.php b/src/Controller/DatabaseConnection.php index 65661ec..e890276 100644 --- a/src/Controller/DatabaseConnection.php +++ b/src/Controller/DatabaseConnection.php @@ -19,6 +19,7 @@ class DatabaseConnection const TABLE_NAMESERVERS = self::TABLE_PREFIX . "nameservers"; const TABLE_PANELS = self::TABLE_PREFIX . "panels"; const TABLE_APIKEYS = self::TABLE_PREFIX . "apikeys"; + const TABLE_DYNDNS = self::TABLE_PREFIX . "dyndns"; public function __construct(private array $config) { @@ -83,6 +84,19 @@ class DatabaseConnection $statement = $this->dbConnection->prepare(query: $sql); $statement->execute(); + $sql = " + CREATE TABLE `dyndns` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `a` VARBINARY(255) NOT NULL, + `aaaa` VARBINARY(255) NOT NULL, + `last_update` TIMESTAMP NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"; + + $statement = $this->dbConnection->prepare(query: $sql); + $statement->execute(); + echo 'Tables have been created.' . PHP_EOL; } exit(1);