Database updates

This commit is contained in:
Pinga 2023-12-17 09:53:12 +02:00
parent 384204f41b
commit 94f839ed5e
3 changed files with 45 additions and 14 deletions

View file

@ -56,6 +56,10 @@
"set @audit_rownum = ifnull(@audit_rownum, 0) + 1;"
],
"tables": {
"launch_phase": {
"audit": true,
"skip": null
},
"domain_tld": {
"audit": true,
"skip": null
@ -76,10 +80,6 @@
"audit": null,
"skip": null
},
"domain_price": {
"audit": true,
"skip": null
},
"reserved_domain_names": {
"audit": true,
"skip": null
@ -233,15 +233,27 @@
"skip": null
},
"ticket_categories": {
"audit": null,
"audit": true,
"skip": null
},
"support_tickets": {
"audit": null,
"audit": true,
"skip": null
},
"ticket_responses": {
"audit": null,
"audit": true,
"skip": null
},
"tmch_claims": {
"audit": true,
"skip": null
},
"tmch_revocation": {
"audit": true,
"skip": null
},
"tmch_crl": {
"audit": true,
"skip": null
}
}

View file

@ -2,13 +2,24 @@ SET FOREIGN_KEY_CHECKS=0;
CREATE DATABASE IF NOT EXISTS `registry`;
CREATE TABLE IF NOT EXISTS `registry`.`launch_phase` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`phase_name` VARCHAR(255) NOT NULL,
`phase_description` TEXT,
`start_date` DATETIME(3),
`end_date` DATETIME(3),
UNIQUE(`phase_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='launch phases';
CREATE TABLE IF NOT EXISTS `registry`.`domain_tld` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`tld` varchar(32) NOT NULL,
`idn_table` varchar(255) NOT NULL,
`secure` TINYINT UNSIGNED NOT NULL,
`launch_phase_id` INT DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tld` (`tld`)
UNIQUE KEY `tld` (`tld`),
FOREIGN KEY (`launch_phase_id`) REFERENCES `launch_phase`(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='domain tld';
CREATE TABLE IF NOT EXISTS `registry`.`settings` (

View file

@ -3,12 +3,22 @@ CREATE SCHEMA registryTransaction;
SET search_path TO registry, registryTransaction, public;
CREATE TABLE registry.launch_phase (
"id" SERIAL PRIMARY KEY,
"phase_name" VARCHAR(255) NOT NULL,
"phase_description" TEXT,
"start_date" TIMESTAMP(3),
"end_date" TIMESTAMP(3),
UNIQUE(phase_name)
);
CREATE TABLE registry.domain_tld (
"id" serial8,
"id" SERIAL PRIMARY KEY,
"tld" varchar(32) NOT NULL,
"idn_table" varchar(255) NOT NULL,
"secure" SMALLINT NOT NULL,
primary key ("id"),
"launch_phase_id" INTEGER DEFAULT NULL,
FOREIGN KEY (launch_phase_id) REFERENCES launch_phase(id),
unique ("tld")
);
@ -19,7 +29,7 @@ CREATE TABLE registry.settings (
);
CREATE TABLE registry.domain_price (
"id" serial8,
"id" SERIAL PRIMARY KEY,
"tldid" int CHECK ("tldid" >= 0) NOT NULL,
"command" varchar CHECK ("command" IN ( 'create','renew','transfer' )) NOT NULL default 'create',
"m0" decimal(10,2) NOT NULL default '0.00',
@ -33,15 +43,13 @@ CREATE TABLE registry.domain_price (
"m96" decimal(10,2) NOT NULL default '0.00',
"m108" decimal(10,2) NOT NULL default '0.00',
"m120" decimal(10,2) NOT NULL default '0.00',
primary key ("id"),
unique ("tldid", "command")
);
CREATE TABLE registry.domain_restore_price (
"id" serial8 ,
"id" SERIAL PRIMARY KEY,
"tldid" int CHECK ("tldid" >= 0) NOT NULL,
"price" decimal(10,2) NOT NULL default '0.00',
primary key ("id"),
unique ("tldid")
);