Home Documentation
Download Report a Bug/Github About Contact

Changes in database and Provider Implementation

Index

  1. Introduction
  2. Database schema changelog
  3. Data-access-api changelog
  4. Database schema migration queries

Introduction

As of today Nov 20th, 2019, the last version of the database is 1.5.0 and the data-access-api version is 1.2.0, the following tables shows the version relation that support each component.

rdap-sql-provider rdap-data-access-api
1.0.0 1.0.0
1.1.0 1.1.0
1.2.0 1.1.1
1.3.0 1.2.0
1.4.0 1.2.0
1.4.1 1.2.0
1.4.2 1.2.0
1.5.0 1.2.0


rdap-server rdap-data-access-api
1.1.0 1.1.0
1.1.1 1.1.0
1.1.2 1.1.0
1.2.0 1.1.1
1.2.1 1.1.1
1.2.2 1.1.1
1.3.0 1.2.0
1.4.0 1.2.0
1.4.1 1.2.0
1.4.3 1.2.0
1.5.0 1.2.0

Database schema changelog

v1.1.0 to v1.2.0

v1.2.0 to v1.3.0

v1.3.0 to v1.4.0

v1.4.0 to v1.4.1

v1.4.1 to v1.5.0

Data-access-api changelog

1.0.0 to 1.1.0

1.1.0 to 1.1.1

1.1.1 to 1.2.0

Database schema migration queries

Here we show some migration queries to ease your migration. Before you start to apply the alter queries, please read the next consideration:

If you meet the previous consideration, then just pick the migration queries fall-through from your current version of database schema.

V1.1.0

ALTER TABLE `rdap`.`rdap_user_role` 
DROP FOREIGN KEY `rdap_user_ir_fk`;

ALTER TABLE `rdap`.`rdap_user` 
DROP COLUMN `rus_id`,
CHANGE COLUMN `rus_name` `rus_name` VARCHAR(100) NOT NULL ,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`rus_name`);

ALTER TABLE `rdap`.`rdap_user_role` 
CHANGE COLUMN `rus_name` `rus_name` VARCHAR(100) NOT NULL ;

ALTER TABLE `rdap`.`rdap_user_role` 
ADD CONSTRAINT `rdap_user_ir_fk`
  FOREIGN KEY (`rus_name`)
  REFERENCES `rdap`.`rdap_user` (`rus_name`);

-- -----------------------------------------------------
-- Table `rdap`.`rdap_access_role`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `rdap`.`rdap_access_role` ;
CREATE TABLE IF NOT EXISTS `rdap`.`rdap_access_role` (
  `rar_name` VARCHAR(45) NOT NULL COMMENT 'Access role\'s name',
  `rar_description` VARCHAR(250) NOT NULL COMMENT 'Access role\'s description',
  PRIMARY KEY (`rar_name`))
ENGINE = InnoDB
COMMENT = 'This table contains a catalog of the access roles that a user could have.';

-- -----------------------------------------------------
-- Table `rdap`.`entity_role`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `rdap`.`entity_role` ;
CREATE TABLE IF NOT EXISTS `rdap`.`entity_role` (
  `ent_id` BIGINT NOT NULL COMMENT 'Entity\'s id',
  `rol_id` TINYINT NOT NULL COMMENT 'Role\'s id',
  PRIMARY KEY (`ent_id`, `rol_id`),
  INDEX `fk_entity_role_roles1_idx` (`rol_id` ASC),
  UNIQUE INDEX `unique_ent_rol` (`ent_id` ASC, `rol_id` ASC),
  CONSTRAINT `fk_entity_role_entity1`
    FOREIGN KEY (`ent_id`)
    REFERENCES `rdap`.`entity` (`ent_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_entity_role_roles1`
    FOREIGN KEY (`rol_id`)
    REFERENCES `rdap`.`roles` (`rol_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
COMMENT = 'This table contains the relation between an Entity and its role.';

-- -----------------------------------------------------
-- Table `rdap`.`link_lang`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `rdap`.`link_lang` ;
CREATE TABLE IF NOT EXISTS `rdap`.`link_lang` (
  `lin_id` BIGINT NOT NULL COMMENT 'Link\'s id',
  `lan_hreflang` VARCHAR(45) NOT NULL COMMENT 'Language',
  PRIMARY KEY (`lin_id`, `lan_hreflang`),
  CONSTRAINT `fk_link_hreflang_link1`
    FOREIGN KEY (`lin_id`)
    REFERENCES `rdap`.`link` (`lin_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
COMMENT = 'This table contains the languages related to a link.';

ALTER TABLE `rdap`.`variant_name` 
ADD COLUMN `vna_unicode_name` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL AFTER `var_id`;

V1.2.0

INSERT INTO rdap.status VALUES(19, 'add period');
INSERT INTO rdap.status VALUES(20, 'auto renew period');
INSERT INTO rdap.status VALUES(21, 'client delete prohibited');
INSERT INTO rdap.status VALUES(22, 'client hold');
INSERT INTO rdap.status VALUES(23, 'client renew prohibited');
INSERT INTO rdap.status VALUES(24, 'client transfer prohibited');
INSERT INTO rdap.status VALUES(25, 'client update prohibited');
INSERT INTO rdap.status VALUES(26, 'pending restore');
INSERT INTO rdap.status VALUES(27, 'redemption period');
INSERT INTO rdap.status VALUES(28, 'renew period');
INSERT INTO rdap.status VALUES(29, 'server delete prohibited');
INSERT INTO rdap.status VALUES(30, 'server renew prohibited');
INSERT INTO rdap.status VALUES(31, 'server transfer prohibited');
INSERT INTO rdap.status VALUES(32, 'server update prohibited');
INSERT INTO rdap.status VALUES(33, 'server hold');
INSERT INTO rdap.status VALUES(34, 'transfer period');

V1.3.0

-- -----------------------------------------------------
-- Table `rdap`.`vcard_contact_uri`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `rdap`.`vcard_contact_uri` ;
CREATE TABLE IF NOT EXISTS `rdap`.`vcard_contact_uri` (
  `vcu_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'Contact URI\'s id',
  `vca_id` BIGINT NOT NULL COMMENT 'Vcard\'s id',
  `vcu_order` INT UNSIGNED NOT NULL COMMENT 'Order of contact',
  `vcu_uri` VARCHAR(255) NOT NULL COMMENT 'Contact URI',
  PRIMARY KEY (`vcu_id`, `vca_id`),
  INDEX `fk_vcard_contact_uri_vcard1_idx` (`vca_id` ASC),
  CONSTRAINT `fk_vcard_contact_uri_1`
    FOREIGN KEY (`vca_id`)
    REFERENCES `rdap`.`vcard` (`vca_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
COMMENT = 'This table contains the VCard Contact URI information.';

ALTER TABLE `rdap`.`nameserver` 
CHANGE COLUMN `nse_unicode_name` `nse_unicode_name` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NULL;

ALTER TABLE `rdap`.`domain` 
CHANGE COLUMN `dom_unicode_name` `dom_unicode_name` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NULL;

ALTER TABLE `rdap`.`vcard_postal_info` 
ADD COLUMN `vpi_country_code` VARCHAR(2) NULL AFTER `vpi_country`;

V1.4.0

ALTER TABLE `rdap`.`variant_name` 
CHANGE COLUMN `vna_unicode_name` `vna_unicode_name` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL;

INSERT INTO rdap.country_code VALUES (531,'CW');
INSERT INTO rdap.country_code VALUES (534,'SX');
INSERT INTO rdap.country_code VALUES (535,'BQ');

V1.5.0

-- -----------------------------------------------------
-- Table `rdap`.`user_consent_by_attributes`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `rdap`.`user_consent_by_attributes` (
  `ent_id` BIGINT NOT NULL,
  `uca_handle` TINYINT NOT NULL,
  `uca_name` TINYINT NOT NULL,
  `uca_companyName` TINYINT NOT NULL,
  `uca_companyURL` TINYINT NOT NULL,
  `uca_email` TINYINT NOT NULL,
  `uca_voice` TINYINT NOT NULL,
  `uca_cellphone` TINYINT NOT NULL,
  `uca_fax` TINYINT NOT NULL,
  `uca_jobTitle` TINYINT NOT NULL,
  `uca_contactUri` TINYINT NOT NULL,
  `uca_type` TINYINT NOT NULL,
  `uca_country` TINYINT NOT NULL,
  `uca_countryCode` TINYINT NOT NULL,
  `uca_city` TINYINT NOT NULL,
  `uca_state` TINYINT NOT NULL,
  `uca_street1` TINYINT NOT NULL,
  `uca_street2` TINYINT NOT NULL,
  `uca_street3` TINYINT NOT NULL,
  `uca_postalCode` TINYINT NOT NULL,
  PRIMARY KEY (`ent_id`),
  UNIQUE INDEX `ent_id_UNIQUE` (`ent_id` ASC),
  CONSTRAINT `fk_user_consent_by_attributes_entity`
    FOREIGN KEY (`ent_id`)
    REFERENCES `rdap`.`entity` (`ent_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
COMMENT = 'Table for user consent by attribute for contact information';

-- -----------------------------------------------------
-- Table `rdap`.`user_global_consent`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `rdap`.`user_global_consent` (
  `ent_id` BIGINT NOT NULL,
  `ugc_consent` TINYINT NOT NULL,
  PRIMARY KEY (`ent_id`),
  UNIQUE INDEX `ent_id_UNIQUE` (`ent_id` ASC),
  CONSTRAINT `fk_user_global_consent_entity`
    FOREIGN KEY (`ent_id`)
    REFERENCES `rdap`.`entity` (`ent_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
COMMENT = 'Table for user global consent for contact information';

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;