Create forum DB structure
Brought to you by:
xquantum
Create database structure. DB must store the following data:
1. User common information.
2. Categories.
3. Sections (can be assigned to category).
4. Topics (can be assigned to section).
5. Posts (can be assigned to topic).
6. Files (can be attached to several topics).
7. User roles (can be assigned to several users).
8. Think about polls realization without creating extra tables.
Must be implemented SP for manage this data.
Created base structure. The following tables are in use:
1. UserInfo. Contains common user information, such as login, password hash, activation hash, email, role ID, etc.
2. Role. Contains roles which can be assigned to user.
3. File. Contains information about physical file uploaded to forum, such as physical path, name, size (in bytes), uploader ID, uploading date, etc.
4. Category. Contains categories info.
5. Section. Contains section info. Can be assigned to category by inner FK.
6. Topic. Contains topic info. To realize polls added "IsPoll" column, which equals "true" when any poll variant assigned to topic.
7. Post. Contains post info, such as creator ID, creation date, editor ID, last edition date, etc. Can be assigned to topic by inner FK.
8. Variant. Contains poll variant info. Can be assigned to topic (after assigning "IsPoll" column in "Topic" table will be set to "true").
UserInfo table:
There's no need to store Activation Link. it can be generated when needed
AccessMask table:
In current state will set rights for all users regardless of user Role.
needs to store userID some way.
Yeah, you're right. The following changes have been made:
1. "ActivationHash" column removed from the "User" table. ActLink will be generated automacially when it'll be necessary.
2. New column "RoleId" added to the "AccessMask" table (FK for "Role" table).
Many SPs added & modified to manage users and topics. Modifications uploaded to Git.
Created basic necessary tables and SP for managing forum. Maybe it's necessary to add some SP for managing files, I'll think about it.