Database

From MoonDragon Wiki

Jump to: navigation, search


This is the new database model, after giving it more thought, the old one won't be posted because it's clearly worst than the new model and there are no elements that can be reused.

The database SQL sentence can be donwloaded here

Database diagram

This is the database entity-relationship diagram

Image:ER_Moon.jpg

Data Dictionary

This is the data dictionary of the database

Table Users
id_user VARCHAR(50) PRIMARY KEY
nickname VARCHAR(50)
password VARCHAR(100)
email VARCHAR(50)
level INT
active BOOLEAN
Table Texts
id_text INT PRIMARY KEY
id_section VARCHAR(15) *
id_user VARCHAR(50)
title VARCHAR(50)
description VARCHAR(255),
content TEXT
type INT
comments BOOLEAN
date DATETIME
Table Comments
id_comment INT PRIMARY KEY
id_text INT *
content TEXT
author VARCHAR(50)
email VARCHAR(50)
web VARCHAR(50)
Table Galleries
id_gallery INT PRIMARY KEY
id_section VARCHAR(15) *
name VARCHAR(50)
description VARCHAR(255),
type INT
Table Images
id_image INT PRIMARY KEY
id_gallery INT *
image VARCHAR(255)
description VARCHAR(255)
Table Tags
id_tag VARCHAR(15) PRIMARY KEY
name VARCHAR(50)
description VARCHAR(255)
Table Texts_Galleries
id_text INT *
id_gallery INT *
Table Texts_Tags
id_text INT *
id_tag VARCHAR(15) *
Table Images_Tags
id_image INT *
id_tag VARCHAR(15) *

The fields marked by * are recommended to be indexed because of its heavy usage. All the tables are mean to be used with the MyISAM engine, there is no need to use transactional tables.

Personal tools