Skip to content

Table Structure Description

1. users (User Table)

Description

Stores system user information, including administrators and regular users.

Field Description

Field NameTypeDescriptionConstraints
idINTUser ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
usernameVARCHAR(50)UsernameUNIQUE, NOT NULL
emailVARCHAR(100)EmailUNIQUE, NOT NULL
passwordVARCHAR(255)Password hashNOT NULL
nicknameVARCHAR(100)Nickname-
avatarVARCHAR(255)Avatar URL-
bioTEXTPersonal introduction-
roleENUMUser roleDEFAULT 'user', VALUES('admin', 'user')
statusENUMUser statusDEFAULT 'active', VALUES('active', 'inactive')
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_username: username
  • idx_email: email

2. categories (Category Table)

Description

Stores article category information.

Field Description

Field NameTypeDescriptionConstraints
idINTCategory ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
nameVARCHAR(100)Category nameNOT NULL
slugVARCHAR(100)Category slugUNIQUE, NOT NULL
descriptionTEXTCategory description-
colorVARCHAR(7)Category colorDEFAULT '#1890ff'
iconVARCHAR(50)Category iconDEFAULT 'fa:folder'
sort_orderINTSort orderDEFAULT 0
statusENUMStatusDEFAULT 'active', VALUES('active', 'inactive')
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_slug: slug
  • idx_sort: sort_order

3. articles (Article Table)

Description

Stores blog article information.

Field Description

Field NameTypeDescriptionConstraints
idINTArticle ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
titleVARCHAR(200)Article titleNOT NULL
contentLONGTEXTArticle content-
summaryVARCHAR(500)Article summary-
cover_imageVARCHAR(500)Cover image URL-
view_countINTView countDEFAULT 0
like_countINTLike countDEFAULT 0
statusENUMPublication statusDEFAULT 'draft', VALUES('draft', 'published')
is_featuredTINYINT(1)Whether featuredDEFAULT 0
allow_commentTINYINT(1)Whether comments allowedDEFAULT 1
author_idINTAuthor IDFOREIGN KEY -> users(id)
category_idINTCategory IDFOREIGN KEY -> categories(id)
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_status: status
  • idx_featured: is_featured
  • idx_view_count: view_count
  • idx_created_at: created_at
  • idx_author: author_id
  • idx_category: category_id

4. projects (Project Table)

Description

Stores project portfolio information.

Field Description

Field NameTypeDescriptionConstraints
idINTProject ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
titleVARCHAR(200)Project titleNOT NULL
descriptionTEXTProject description-
contentLONGTEXTProject detail content-
statusENUMProject statusDEFAULT 'draft', VALUES('draft', 'published')
is_featuredTINYINT(1)Whether special projectDEFAULT 0
categoryINTProject categoryNOT NULL
technologiesJSONTechnology stack-
cover_image_idINTCover image IDFOREIGN KEY -> files(id)
view_countINTView countDEFAULT 0
like_countINTLike countDEFAULT 0
demo_urlVARCHAR(255)Demo URL-
github_urlVARCHAR(255)GitHub URL-
roleVARCHAR(100)Job role-
sort_orderINTSort orderDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_category: category
  • idx_cover_image: cover_image_id
  • idx_sort_order: sort_order
  • idx_title_desc: FULLTEXT(title, description)

Description

Stores gallery information.

Field Description

Field NameTypeDescriptionConstraints
idINTGallery ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
titleVARCHAR(200)Gallery titleNOT NULL
descriptionTEXTGallery description-
cover_imageVARCHAR(500)Cover image URL-
view_countINTView countDEFAULT 0
comment_countINTComment countDEFAULT 0
statusENUMPublication statusDEFAULT 'draft', VALUES('draft', 'published')
is_featuredTINYINT(1)Whether featuredDEFAULT 0
sort_orderINTSort orderDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_status: status
  • idx_featured: is_featured
  • idx_view_count: view_count
  • idx_sort_order: sort_order
  • idx_created_at: created_at

6. resources (Resource Table)

Description

Stores resource download information.

Field Description

Field NameTypeDescriptionConstraints
idINTResource ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
titleVARCHAR(200)Resource titleNOT NULL
descriptionTEXTResource description-
contentLONGTEXTResource detail content-
category_idINTResource category IDFOREIGN KEY -> resource_categories(id)
subcategoryVARCHAR(100)Resource subcategory-
file_idINTFile IDFOREIGN KEY -> files(id)
cover_image_idINTCover image IDFOREIGN KEY -> files(id)
file_typeVARCHAR(50)File type-
file_sizeBIGINTFile size (bytes)-
download_codeVARCHAR(20)Download codeUNIQUE
download_countINTDownload countDEFAULT 0
view_countINTView countDEFAULT 0
like_countINTLike countDEFAULT 0
statusENUMPublication statusDEFAULT 'draft', VALUES('draft', 'published')
is_featuredTINYINT(1)Whether featuredDEFAULT 0
sort_orderINTSort orderDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_category: category_id
  • idx_file: file_id
  • idx_cover: cover_image_id
  • idx_download_code: download_code
  • idx_status: status
  • idx_sort: sort_order
  • idx_title_desc: FULLTEXT(title, description)

7. skills (Skill Table)

Description

Stores skill item information.

Field Description

Field NameTypeDescriptionConstraints
idINTSkill ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
category_idINTCategory IDFOREIGN KEY -> skill_categories(id), NOT NULL
nameVARCHAR(100)Skill nameNOT NULL
levelENUMSkill levelDEFAULT 'intermediate', VALUES('beginner', 'intermediate', 'advanced', 'expert')
colorVARCHAR(7)Skill colorDEFAULT '#1890ff'
descriptionTEXTSkill description-
statusENUMStatusDEFAULT 'active', VALUES('active', 'inactive')
sort_orderINTSort orderDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_category: category_id
  • idx_sort: sort_order

8. files (File Table)

Description

Stores file information, supporting multiple storage methods.

Field Description

Field NameTypeDescriptionConstraints
idINTFile ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
original_nameVARCHAR(255)Original filenameNOT NULL
file_nameVARCHAR(255)Storage filenameNOT NULL
file_pathVARCHAR(500)File relative pathNOT NULL
file_sizeBIGINTFile size (bytes)NOT NULL
mime_typeVARCHAR(100)File typeNOT NULL
storage_typeVARCHAR(100)Storage typeDEFAULT 'local'
categoryVARCHAR(100)File categoryNOT NULL
bucket_nameVARCHAR(100)Storage bucket name-
file_hashVARCHAR(64)File hash value (SHA-256)NOT NULL
statusENUMFile statusDEFAULT 'active', VALUES('active', 'deleted')
created_byINTUpload user IDFOREIGN KEY -> users(id)
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_category: category
  • idx_storage_type: storage_type
  • idx_created_by: created_by
  • idx_created_at: created_at
  • idx_file_hash: file_hash

Description

Stores homepage carousel information.

Field Description

Field NameTypeDescriptionConstraints
idINTCarousel ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
titleVARCHAR(200)Carousel titleNOT NULL
subtitleVARCHAR(200)Carousel subtitle-
descriptionTEXTCarousel description-
coverVARCHAR(500)Cover image URLNOT NULL
show_titleTINYINT(1)Whether to show titleDEFAULT 1
primary_textVARCHAR(100)Primary button textDEFAULT 'Learn more'
primary_linkVARCHAR(500)Primary button link-
secondary_textVARCHAR(100)Secondary button textDEFAULT 'View details'
secondary_linkVARCHAR(500)Secondary button link-
sort_orderINTSort orderDEFAULT 0
statusENUMStatusDEFAULT 'active', VALUES('active', 'inactive')
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_status: status
  • idx_sort_order: sort_order
  • idx_created_at: created_at

10. wall_messages (Message Table)

Description

Stores message information.

Field Description

Field NameTypeDescriptionConstraints
idINTMessage ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
contentTEXTMessage contentNOT NULL
author_nameVARCHAR(100)Author nameDEFAULT 'Anonymous'
author_emailVARCHAR(100)Author email-
author_websiteVARCHAR(200)Author website-
labelVARCHAR(50)Message labelDEFAULT 'Message'
bg_colorVARCHAR(50)Background colorDEFAULT 'rgba(146, 230, 245, 0.3)'
like_countINTLike countDEFAULT 0
comment_countINTComment countDEFAULT 0
statusENUMMessage statusDEFAULT 'pending', VALUES('pending', 'approved', 'rejected')
ip_addressVARCHAR(50)IP address-
user_agentVARCHAR(500)User agent-
sort_orderINTSort orderDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_status: status
  • idx_label: label
  • idx_created_at: created_at
  • idx_sort_order: sort_order

11. settings (System Settings Table)

Description

Stores system configuration information.

Field Description

Field NameTypeDescriptionConstraints
idINTSettings ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
group_nameVARCHAR(100)Settings groupNOT NULL
key_nameVARCHAR(100)Settings keyNOT NULL
key_valueTEXTSettings value-
descriptionVARCHAR(255)Settings description-
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Unique Index

  • unique_group_key: (group_name, key_name)

12. skill_categories (Skill Category Table)

Description

Stores skill category information.

Field Description

Field NameTypeDescriptionConstraints
idINTCategory ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
nameVARCHAR(100)Skill category nameNOT NULL
iconVARCHAR(50)Category iconDEFAULT 'fa:code'
descriptionTEXTCategory description-
colorVARCHAR(7)Category colorDEFAULT '#1890ff'
statusENUMStatusDEFAULT 'active', VALUES('active', 'inactive')
sort_orderINTSort orderDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_sort: sort_order

13. resource_categories (Resource Category Table)

Description

Stores resource category information.

Field Description

Field NameTypeDescriptionConstraints
idINTCategory ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
nameVARCHAR(100)Category nameNOT NULL
slugVARCHAR(100)Category slugUNIQUE, NOT NULL
descriptionTEXTCategory description-
iconVARCHAR(50)Category iconDEFAULT 'fa:folder'
colorVARCHAR(7)Category colorDEFAULT '#1890ff'
sort_orderINTSort orderDEFAULT 0
statusENUMStatusDEFAULT 'active', VALUES('active', 'inactive')
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_slug: slug
  • idx_sort: sort_order

Description

Stores images within galleries.

Field Description

Field NameTypeDescriptionConstraints
idINTImage ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
gallery_idINTGallery IDFOREIGN KEY -> galleries(id), NOT NULL
titleVARCHAR(200)Image title-
descriptionTEXTImage description-
file_idINTFile IDFOREIGN KEY -> files(id), NOT NULL
sort_orderINTSort orderDEFAULT 0
statusENUMStatusDEFAULT 'active', VALUES('active', 'inactive')
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Indexes

  • idx_gallery_id: gallery_id
  • idx_file_id: file_id
  • idx_sort_order: sort_order

15. visit_hourly_statistics (Hourly Visit Statistics Table)

Description

Stores hourly visit statistics information.

Field Description

Field NameTypeDescriptionConstraints
idINTStatistics ID (Primary Key)PRIMARY KEY, AUTO_INCREMENT
dateDATEStatistics dateNOT NULL
hourTINYINTHour (0-23)NOT NULL
total_visitsINTTotal visitsDEFAULT 0
increment_visitsINTIncremental visitsDEFAULT 0
created_atTIMESTAMPCreation timeDEFAULT CURRENT_TIMESTAMP
updated_atTIMESTAMPUpdate timeDEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Unique Index

  • unique_date_hour: (date, hour)

Indexes

  • idx_date_hour: (date, hour)
  • idx_hour: hour

Foreign Key Relationship Summary

Child TableForeign Key FieldParent Table
articlesauthor_idusers
articlescategory_idcategories
projectscover_image_idfiles
resourcescategory_idresource_categories
resourcesfile_idfiles
resourcescover_image_idfiles
skillscategory_idskill_categories
filescreated_byusers
gallery_imagesgallery_idgalleries
gallery_imagesfile_idfiles

For detailed field descriptions, please refer to Field Descriptions.