Added application table in DB

This commit is contained in:
Pinga 2023-12-17 10:21:52 +02:00
parent 0eb4ee83da
commit 69511da3d5
3 changed files with 107 additions and 0 deletions

View file

@ -132,6 +132,10 @@
"audit": true, "audit": true,
"skip": null "skip": null
}, },
"application": {
"audit": true,
"skip": null
},
"domain": { "domain": {
"audit": true, "audit": true,
"skip": null "skip": null

View file

@ -333,6 +333,61 @@ CREATE TABLE IF NOT EXISTS `registry`.`domain` (
CONSTRAINT `domain_ibfk_7` FOREIGN KEY (`tldid`) REFERENCES `domain_tld` (`id`) ON DELETE RESTRICT CONSTRAINT `domain_ibfk_7` FOREIGN KEY (`tldid`) REFERENCES `domain_tld` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='domain'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='domain';
CREATE TABLE IF NOT EXISTS `registry`.`application` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(68) NOT NULL,
`tldid` int(10) unsigned NOT NULL,
`registrant` int(10) unsigned default NULL,
`crdate` datetime(3) NOT NULL,
`exdate` datetime(3) NOT NULL,
`lastupdate` datetime(3) default NULL,
`clid` int(10) unsigned NOT NULL,
`crid` int(10) unsigned NOT NULL,
`upid` int(10) unsigned default NULL,
`trdate` datetime(3) default NULL,
`trstatus` enum('clientApproved','clientCancelled','clientRejected','pending','serverApproved','serverCancelled') default NULL,
`reid` int(10) unsigned default NULL,
`redate` datetime(3) default NULL,
`acid` int(10) unsigned default NULL,
`acdate` datetime(3) default NULL,
`transfer_exdate` datetime(3) default NULL,
`idnlang` varchar(16) default NULL,
`delTime` datetime(3) default NULL,
`resTime` datetime(3) default NULL,
`rgpstatus` enum('addPeriod','autoRenewPeriod','renewPeriod','transferPeriod','pendingDelete','pendingRestore','redemptionPeriod') default NULL,
`rgppostData` text default NULL,
`rgpdelTime` datetime(3) default NULL,
`rgpresTime` datetime(3) default NULL,
`rgpresReason` text default NULL,
`rgpstatement1` text default NULL,
`rgpstatement2` text default NULL,
`rgpother` text default NULL,
`addPeriod` tinyint(3) unsigned default NULL,
`autoRenewPeriod` tinyint(3) unsigned default NULL,
`renewPeriod` tinyint(3) unsigned default NULL,
`transferPeriod` tinyint(3) unsigned default NULL,
`renewedDate` datetime(3) default NULL,
`agp_exempted` tinyint(1) DEFAULT 0,
`agp_request` datetime(3) default NULL,
`agp_grant` datetime(3) default NULL,
`agp_reason` text default NULL,
`agp_status` varchar(30) default NULL,
`tm_notice_accepted` datetime(3) default NULL,
`tm_notice_expires` datetime(3) default NULL,
`tm_notice_id` varchar(150) default NULL,
`tm_notice_validator` varchar(30) default NULL,
`tm_smd_id` text default NULL,
`tm_phase` TEXT NOT NULL DEFAULT 'NONE',
PRIMARY KEY (`id`),
CONSTRAINT `application_ibfk_1` FOREIGN KEY (`clid`) REFERENCES `registrar` (`id`) ON DELETE RESTRICT,
CONSTRAINT `application_ibfk_2` FOREIGN KEY (`crid`) REFERENCES `registrar` (`id`) ON DELETE RESTRICT,
CONSTRAINT `application_ibfk_3` FOREIGN KEY (`upid`) REFERENCES `registrar` (`id`) ON DELETE RESTRICT,
CONSTRAINT `application_ibfk_4` FOREIGN KEY (`registrant`) REFERENCES `contact` (`id`) ON DELETE RESTRICT,
CONSTRAINT `application_ibfk_5` FOREIGN KEY (`reid`) REFERENCES `registrar` (`id`) ON DELETE RESTRICT,
CONSTRAINT `application_ibfk_6` FOREIGN KEY (`acid`) REFERENCES `registrar` (`id`) ON DELETE RESTRICT,
CONSTRAINT `application_ibfk_7` FOREIGN KEY (`tldid`) REFERENCES `domain_tld` (`id`) ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='application';
CREATE TABLE IF NOT EXISTS `registry`.`domain_contact_map` ( CREATE TABLE IF NOT EXISTS `registry`.`domain_contact_map` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`domain_id` int(10) unsigned NOT NULL, `domain_id` int(10) unsigned NOT NULL,

View file

@ -322,6 +322,54 @@ CREATE TABLE registry.domain (
unique ("name") unique ("name")
); );
CREATE TABLE registry.application (
"id" serial8,
"name" varchar(68) NOT NULL,
"tldid" int CHECK ("tldid" >= 0) NOT NULL,
"registrant" int CHECK ("registrant" >= 0) default NULL,
"crdate" timestamp(3) without time zone NOT NULL,
"exdate" timestamp(3) without time zone NOT NULL,
"lastupdate" timestamp(3) without time zone default NULL,
"clid" int CHECK ("clid" >= 0) NOT NULL,
"crid" int CHECK ("crid" >= 0) NOT NULL,
"upid" int CHECK ("upid" >= 0) default NULL,
"trdate" timestamp(3) without time zone default NULL,
"trstatus" varchar CHECK ("trstatus" IN ( 'clientApproved','clientCancelled','clientRejected','pending','serverApproved','serverCancelled' )) default NULL,
"reid" int CHECK ("reid" >= 0) default NULL,
"redate" timestamp(3) without time zone default NULL,
"acid" int CHECK ("acid" >= 0) default NULL,
"acdate" timestamp(3) without time zone default NULL,
"transfer_exdate" timestamp(3) without time zone default NULL,
"idnlang" varchar(16) default NULL,
"deltime" timestamp(3) without time zone default NULL,
"restime" timestamp(3) without time zone default NULL,
"rgpstatus" varchar CHECK ("rgpstatus" IN ( 'addPeriod','autoRenewPeriod','renewPeriod','transferPeriod','pendingDelete','pendingRestore','redemptionPeriod' )) default NULL,
"rgppostdata" text default NULL,
"rgpdeltime" timestamp(3) without time zone default NULL,
"rgprestime" timestamp(3) without time zone default NULL,
"rgpresreason" text default NULL,
"rgpstatement1" text default NULL,
"rgpstatement2" text default NULL,
"rgpother" text default NULL,
"addperiod" smallint CHECK ("addperiod" >= 0) default NULL,
"autorenewperiod" smallint CHECK ("autorenewperiod" >= 0) default NULL,
"renewperiod" smallint CHECK ("renewperiod" >= 0) default NULL,
"transferperiod" smallint CHECK ("transferperiod" >= 0) default NULL,
"reneweddate" timestamp(3) without time zone default NULL,
"agp_exempted" BOOLEAN DEFAULT FALSE,
"agp_request" TIMESTAMP(3) DEFAULT NULL,
"agp_grant" TIMESTAMP(3) DEFAULT NULL,
"agp_reason" TEXT DEFAULT NULL,
"agp_status" VARCHAR(30) DEFAULT NULL,
"tm_notice_accepted" TIMESTAMP(3) DEFAULT NULL,
"tm_notice_expires" TIMESTAMP(3) DEFAULT NULL,
"tm_notice_id" VARCHAR(150) DEFAULT NULL,
"tm_notice_validator" VARCHAR(30) DEFAULT NULL,
"tm_smd_id" TEXT DEFAULT NULL,
"tm_phase" text DEFAULT 'NONE'::text NOT NULL,
primary key ("id")
);
CREATE TABLE registry.domain_contact_map ( CREATE TABLE registry.domain_contact_map (
"id" serial8, "id" serial8,
"domain_id" int CHECK ("domain_id" >= 0) NOT NULL, "domain_id" int CHECK ("domain_id" >= 0) NOT NULL,