You are on page 1of 23

Starlight Portal Database Design

Author: Jasper Lau


Date: 2005-6-17

Version 0.93 RC1


© Copyright 2003-2005 Zhibo Liu. All Rights Reserved
Revision History

Version Date Abstract Author


0.93 RC1 2005-6-17 Initialize the document Jasper Lau
Tables:
 System:
1. system_settings
2. system_mainmenu
 Skin:
3. skins
4. skin_layouts
 Security:
5. security_permissions
6. security_policies
 Account:
7. accounts
8. users
9. group_user
10. account_settings
11. account_layouts
12. account_custom_modules
13. account_categories
 Blog:
14. posts
15. post_comments
16. post_categories
 News:
17. news
18. news_categories
 Documents:
19. documents
 Files:
20. files

Instruction:
 The fields with gray background are required
 The bold fields are primary keys
 The italic fields are foreign keys.

1. system_settings
Note: the table contains the settings of system
Field Type Default Value Description
enable_script bool false Enable user post
scripts in the
content
enable_logging bool true Enable logging
remove_logging_day int 10 remove logging
s records 10 days
ago.
default_diskspace int 10 10M
enable_user_register bool false
news_image_width int 100 The maximum
width of news
image
policy_guid guid(string32) Guid.New The policy of the
system security

Index:

Constraint Rules:
2. system_mainmenu
Note: main menu items
Field Type Default Value Description
item_guid Guid(string32) Guid.New
item_text string50 Unique in the
system
item_url string255
item_order int The maximum
number

Index:
item_text
Constraint Rules:
 item_text: unique in the system
3. skins
Note: the skin collection
Field Type Default Value Description
skin_guid Guid(string32) Guid.New
skin_name string50 Unique in the
system
image_guid Guid(string32) Guid.Empty The image guid
in the files table
use_custom_portalcss bool Substitute the
portal.css with
custom css
content
portal_css text The custom
portal css

Index:
skin_name
Constraint Rules:
 skin_name: unique in the system
 image_guid: the image must be 400*300(W*H)
4. skin_layouts
Note: the layouts of skin
Field Type Default Value Description
skin_guid Guid(string32)
page_name string50 The page name
in the
portal.config file
page_layout text The layout

Index:
page_name
Constraint Rules:
5. security_permissions
Note: The permission bit definition
Field Type Default Value Description
permission_bit int The flag bit
permission_dspt string255 The description of
the permission
permission_type string50 System
Account
AccountCategory
AccountDocument

Index:
permission_type
Constraint Rules:
 permission_bit: one bit of a int
6. security_policies
Note: The security policies for the system, account and document etc.
Field Type Default Value Description
policy_guid Guid(string32)
security_account_gui Guid(string32) The account guid
d
permissions int permission bits

Index:

Constraint Rules:
7. accounts
Note: The accounts in the system
Field Type Default Value Description
account_guid Guid(string32) Guid.New
account_type string50 Group
User
account_name string50 Unique in the
system, contains
numbers, letters
and underscore
friendly_name string50
account_dspt string255
disk_space int 10 The unit is MB
used_space int 0 The unit is byte

Index:
account_name
Constraint Rules:
 account_name: unique in the system, contains only numbers, letters
and underscore(_).
8. users
Note: the users of the system
Field Type Default Value Description
user_guid Guid(string32)
user_pwd string50 length greater
than 6
email string50
mobile_phone string50
enabled bool true
last_logon_time DateTime DateTime.Now

Index:

Constraint Rules:
 user_pwd: the length greater than 6
9. group_user
Note: The group and user relationship
Field Type Default Value Description
group_guid Guid(string32)
user_guid Guid(string32)

Index:

Constraint Rules:
10. account_settings
Note: The settings of the account
Field Type Default Value Description
account_guid Guid(string32)
site_name string255
skin_guid Guid(string32) Guid.Empty
logo_guid Guid(string32) Guid.Empty
use_custom_portalcss bool false
css_content text
blog_rss_count int 50
policy_guid Guid(string32) Guid.New

Index:

Constraint Rules:
11. account_layouts
Note: The layouts definition of account’s pages
Field Type Default Value Description
account_guid Guid(string32)
page_name string50 The page name
in the
portal.config file
page_layout text

Index:

Constraint Rules:
12. account_custom_modules
Note: The custom modules definition of the account
Field Type Default Value Description
module_guid Guid(string32)
account_guid Guid(string32)
module_name string50
css text
content text

Index:

Constraint Rules:
 module_name: unique in the account
13. account_categories
Note: The categories of the account
Field Type Default Value Description
category_guid Guid(string32)
account_guid Guid(string32)
category_name string50
category_type string50 Blog
News
category_dspt string255
policy_guid Guid(string32)

Index:

Constraint Rules:
 category_name: unique in the type.
14. posts
Note: The posts
Field Type Default Value Description
post_guid Guid(string32)
title string255
content text string.Empty
publisher_guid Guid(string32) The user logged
in.
publish_time DateTime DateTime.Now
comment_count int 0
viewed int 1
size int 0
trackback_count int 0
friendly_url string255 string.Empty

Index:

Constraint Rules:
 friendly_url: unique in the posts of the account.
 title: can’t be empty
15. post_comments
Note: The comments and trackback pings for the posts
Field Type Default Value Description
comment_guid Guid(string32)
post_guid Guid(string32)
title string255
content text string.Empty
user string50
user_url string255
publish_time DateTime DateTime.Now

Index:

Constraint Rules:
 title: can’t be empty
 user: can’t be empty
16. post_categories
Note: The post and category relationship
Field Type Default Value Description
post_guid Guid(string32)
category_guid Guid(string32)

Index:

Constraint Rules:
17. news
Note: The news entries of the account
Field Type Default Value Description
news_guid Guid(string32)
account_guid Guid(string32)
title string255
keywords string255 string.Empty
abstract text string.Empty
content text string.Empty
image_guid Guid(string32) Guid.Empty
publish_time DateTime DateTime.Now
publisher string50
viewed int 1
size int 0
friendly_url string255

Index:

Constraint Rules:
 friendly_url: unique in the news of the account.
 title: can’t be empty
18. news_categories
Note: The news and category relationship
Field Type Default Value Description
news_guid Guid(string32)
category_guid Guid(string32)

Index:

Constraint Rules:
19. documents
Note: The documents of the account
Field Type Default Value Description
item_guid Guid(string32)
account_guid Guid(string32)
item_name string255 Unique in the
children of the
parent
item_type string50 Folder
File
item_dspt string255 string.Empty
file_guid Guid(string32) Guid.Empty
inherited_security bool true
policy_guid Guid(string32) The policy_guid
of the parent
parent_guid Guid(string32) The parent guid
created_by string50 The user logged
in
created_time DateTime DateTime.Now
modified_by string50 The user logged
in
modified_time DateTime DateTime.Now
locked bool false
locked_by Guid(string32) Guid.Empty
download_times int 0

Index:

Constraint Rules:
 item_name: unique in the children of the parent.
20. files
Note: The files for the
Field Type Default Value Description
file_guid Guid(string32)
reference_type string50 UserTemporary
System
Account
Blog
News
Docuement
reference_guid Guid(string32)
file_name string255 The file name
content_type string50 The content type
of the file
file_size int The file size
file_stream binary The file binary
stream

Index:

Constraint Rules:

You might also like