Yukatan data model 0.9 Yukatan data model

Yukatan data model 1.0

The Yukatan data model has now reached the stage where it should be ready for production use. This version cleans up and documents the data model that has developed since version 0.1. The major changes in this version are the removal of the envelope data added in version 0.5 and the renaming and redefinition of some of the fields and tables. The database structure has also been extensively documented.

This page documents only the changes since the previous data model version. See the SQL schema file for documentation on the entire data model.

Note that the previously used abstract terms "relation" and "attribute" have now been replaced with the corresponding more concrete terms "table" and "field".

New data types

The special data types commonly used in the Yukatan data model have been made explicit by the introduction of seven new domains. The domains and the related COMMENT statements make field semantics more clear than before.

CREATE DOMAIN msgno_domain AS INTEGER;
CREATE DOMAIN entno_domain AS INTEGER;
CREATE DOMAIN norm_domain  AS CHARACTER VARYING
                              CHECK (TRIM(BOTH FROM LOWER(VALUE)) = VALUE);
CREATE DOMAIN id_domain    AS CHARACTER VARYING
                              CHECK (TRIM(BOTH FROM VALUE) = VALUE);
CREATE DOMAIN name_domain  AS CHARACTER VARYING
                              CHECK (TRIM(BOTH FROM VALUE) = VALUE);
CREATE DOMAIN addr_domain  AS CHARACTER VARYING
                              CHECK (TRIM(BOTH FROM VALUE) = VALUE);
CREATE DOMAIN mime_domain  AS CHARACTER VARYING;

See the SQL schema file for more detailed documentation on these domains.

Explicitly named constraints

All the table constraints in the database are now explicitly named and documented. This change makes the database implementation more orthogonal and cleans up the documentation.

Renamed fields and tables

All the *address field names have been truncated to *addr, to make it visually clearer that they are always paired with the corresponding *name fields. The change also makes parts of the documentation less repetitive.

The referencesfield table has been renamed to referencefield to avoid the plural form in the table name. Also all the contained references* field names have been renamed to reference*.

Semantic changes

Quite a few changes have been made to the semantics of various fields. The unnecessarily tight constraints on sequence numbers have been replaced with clearer documentation, the format and encoding of most fields has been explicitly documented, and the previously allowed dual use of the enttext and enddata fields has been prohibited.

Dropped envelope data

The envelope data added in version 0.5 of the data model has for now been removed. The reason for the removal is that the envelope data is not an integral part of an email message, and I wanted to make the version 1.0 as clear as possible. The database now stores "email messages" - nothing less, nothing more. Envelope data can and probably will be reintroduced in an incremental version 1.x along with other extensions.

SQL schema

The full SQL schema of the Yukatan data model 1.0 is included as the attached SQL schema file.

The schema file now contains extensive documentation in the form of COMMENT statements that make the database self-documenting.

Additional notes

Instead of continuing work on the data model, I will now focus more on the application side of Yukatan webmail. The plan is to freeze the data model for a while to better be able to develop software on top of it. Also all 1.x versions shall be fully backwards-compatible with the 1.0 version of the data model.

SourceForge.net Logo