From 22e2d57b619a9963e7e539889a101da1946554fe Mon Sep 17 00:00:00 2001 From: tracer Date: Wed, 6 Apr 2022 16:26:35 +0200 Subject: [PATCH] added support for dyndns Signed-off-by: tracer --- src/Controller/DatabaseConnection.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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);