Couple of tiny changes

This commit is contained in:
Pinga 2024-03-05 23:41:20 +02:00
parent 7482e77c1c
commit 420bd952f8
4 changed files with 18 additions and 8 deletions

View file

@ -1027,6 +1027,7 @@ class SystemController extends Controller
}
$db = $this->container->get('db');
$uri = $request->getUri()->getPath();
$typesResult = $db->select("SELECT DISTINCT type FROM reserved_domain_names");
// Initialize $types as an empty array if the query result is null

9
cp/bin/create_token.php Normal file
View file

@ -0,0 +1,9 @@
<?php
require __DIR__ . '/../vendor/autoload.php';
use Ramsey\Uuid\Uuid;
$uniqueIdentifier = Uuid::uuid4()->toString();
echo $uniqueIdentifier . PHP_EOL;

View file

@ -68,13 +68,13 @@ CREATE TABLE IF NOT EXISTS `registry`.`allocation_tokens` (
domain_name VARCHAR(255) DEFAULT NULL,
tokenStatus VARCHAR(100) DEFAULT NULL,
tokenType VARCHAR(100) DEFAULT NULL,
createDateTime TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
lastUpdate DATETIME(3) DEFAULT NULL,
crdate DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
lastupdate DATETIME(3) DEFAULT NULL,
registrars JSON DEFAULT NULL,
tlds JSON DEFAULT NULL,
eppActions JSON DEFAULT NULL,
reducePremium TINYINT(1) NOT NULL,
reduceYears INT NOT NULL CHECK (reduceYears BETWEEN 0 AND 10),
reducePremium TINYINT(1) DEFAULT NULL,
reduceYears INT DEFAULT NULL CHECK (reduceYears BETWEEN 0 AND 10),
PRIMARY KEY (token)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='allocation tokens';

View file

@ -66,13 +66,13 @@ CREATE TABLE allocation_tokens (
"domain_name" VARCHAR(255),
"tokenStatus" VARCHAR(100),
"tokenType" VARCHAR(100),
"createDateTime" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastUpdate" TIMESTAMP(3),
"crdate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastupdate" TIMESTAMP(3),
"registrars" JSON,
"tlds" JSON,
"eppActions" JSON,
"reducePremium" BOOLEAN NOT NULL,
"reduceYears" INT NOT NULL CHECK ("reduceYears" BETWEEN 0 AND 10),
"reducePremium" BOOLEAN,
"reduceYears" INT CHECK ("reduceYears" BETWEEN 0 AND 10),
PRIMARY KEY (token)
);