Information Publishing System jquery + MVC Architecture Development (2) database design under EA

Source: Internet
Author: User

Database Design tools we still use enterprise connector 7.5 in Chinese

Here I will introduce ea a little. I personally prefer enterprise impact ect. This tool is similar to Rational Rose.

The cracked version is available on the Internet. It supports full-Process Modeling from Requirement Analysis to design deployment.

We used its use case modeling. Next we started to use its database modeling. The following is the EA operation interface:

 

Double-click the data model under the model on the right and select the table under the class on the left to create a new table:

 

The key here is to select a database: I chose SQL Server 2005. after entering the data name, select table detail:

 

Select columns/variables:

 

Defines the column name and data type for the table, as well as constraints and Foreign keys.

To add a link between a table and a table, you can select the link icon of the operation (the first one ):

 

Double-click the newly created Association (that is, the link just created above) and select:

 

Select the primary foreign key and level (that is, one-to-many ).

Note that source role indicates the master table, and target role indicates the slave table.

Below are the databases I have defined:

 

 

After modeling, you can generate an SQL statement to create a database:

Select all objects as follows:

 

Enter the following window:

 

Select generate primary/foreign key, generate index/constraint (you can generate according to your own needs), and then save:

The generated SQL statement is as follows:

Create Table userinfo (

Userid int not null,

Isadmin tinyint not null,

Username nvarchar (50) not null,

Createdate datetime,

Modifydate datetime

)

;

 

Create Table Info (

Infoid int not null,

Infoname nvarchar (200) not null,

Infocontent text,

Typeid int,

Pictureurl nvarchar (4000 ),

Createid int,

Createdate datetime,

Modifydate datetime,

Attachmenturl nvarchar (4000 ),

Istop tinyint

)

;

 

Create Table infotype (

Typeid int not null,

Typename nvarchar (100 ),

Createid int,

Istop tinyint,

Createdate datetime,

Modifydate datetime

)

;

 

 

Alter table userinfo add constraint pk_user

Primary Key clustered (userid)

;

 

Alter table info add constraint pk_info

Primary Key clustered (infoid)

;

 

Alter table infotype add constraint pk_infotype

Primary Key clustered (typeid)

;

 

 

Alter table infotype

Add constraint uq_infotype_typename unique (typename)

;

Create a database in SQL Server and run the SQL statement generated above.

This completes the database design.

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.