Web Rights Database Design

Source: Internet
Author: User

The CREATE TABLE account (accid INT DEFAULT ' 0 ' is not NULL, Acccode CHAR, Accname VARCHAR (30), PRIMARY KEY (accid)) Engine=innodb DEFAULT Charset=utf8;        CREATE TABLE Role (Roleid INT DEFAULT ' 0 ' not NULL, Rolecode CHAR, RoleName VARCHAR (30), PRIMARY KEY (Roleid)) Engine=innodb DEFAULT Charset=utf8; CREATE TABLE accrole (accroleid int DEFAULT ' 0 ' not NULL, faccid int, Froleid int, PRIM ARY Key (Accroleid), CONSTRAINT accrole_fk1 FOREIGN KEY (faccid) REFERENCES account (accid), CONSTRAINT Acc ROLE_FK2 FOREIGN KEY (Froleid) REFERENCES role (Roleid), index ACCROLE_FK1 (faccid), index ACCROLE_FK2 (frol Eid)) Engine=innodb DEFAULT Charset=utf8;        CREATE TABLE Module (modid INT DEFAULT ' 0 ' not NULL, Modcode CHAR, ModName VARCHAR (30), Parentcode CHAR, url VARCHAR (PRIMARY KEY (Modid))    Engine=innodb DEFAULT Charset=utf8;         CREATE TABLE Privilege (priid INT DEFAULT ' 0 ' not NULL, Pricode CHAR (), Priname VARCHAR (30), PRIMARY KEY (priid)) Engine=innodb DEFAULT Charset=utf8; CREATE TABLE modpri (modpriid int DEFAULT ' 0 ' not NULL, Modid int, priid int, PRIMARY K EY (MODPRIID), CONSTRAINT modpri_fk1 FOREIGN KEY (modid) REFERENCES module (modid), CONSTRAINT modpri_fk2 F    Oreign KEY (PRIID) REFERENCES Privilege (priid), index MODPRI_FK1 (modid), index MODPRI_FK2 (PRIID)) Engine=innodb DEFAULT Charset=utf8;        CREATE TABLE rolemodpri (rolemodpri int DEFAULT ' 0 ' not NULL, Roleid int, modpriid int, PRIMARY Key (ROLEMODPRI), CONSTRAINT rolemodpri_fk1 FOREIGN KEY (Roleid) REFERENCES role (Roleid), Constra  INT rolemodpri_fk2 FOREIGN KEY (modpriid) REFERENCES Modpri (modpriid), index ROLEMODPRI_FK1 (roleid), indexROLEMODPRI_FK2 (MODPRIID)) Engine=innodb DEFAULT Charset=utf8; 


Design diagram:


Attachment:

http://download.csdn.net/detail/linzhichao12345/7741975

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.