How to put UNIQUE constraint and foreign key constraint

How to put UNIQUE constraint and foreign key constraint

Rahul Rai發表於
Number of replies: 4

Hi

I want to create a table through XMLDB editor. I have a one column. In column, i want to put UNIQUE constraint and foreign key constraint, How it is possible. because after create foreign key constraint than i want to create UNIQUE constraint, that is showing error

Save key

This field is used as key.

評比平均分數: -
In reply to Rahul Rai

Re: How to put UNIQUE constraint and foreign key constraint

William Lu發表於
Particularly helpful Moodlers的相片

You posted into a wrong forum, moving to General help forum now.

In reply to Rahul Rai

Re: How to put UNIQUE constraint and foreign key constraint

Marcus Green發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

Moodle discards pk/fk relationships during the installation process so they are mainly of use for documentation rather than actually enforcing referential integrity. Some of the links off this page cover this issue

http://www.examulator.com/er/

評比平均分數:Useful (1)
In reply to Marcus Green

Re: How to put UNIQUE constraint and foreign key constraint

José de Jesús發表於

Hello, Marcus Green:

Excellent!

Thank you very much. This helps us to better understand how database tables are related.

Regards,

José de Jesús.

評比平均分數:Useful (1)
In reply to Rahul Rai

Re: How to put UNIQUE constraint and foreign key constraint

Deepak Gour發表於

Hi Rahul

I understand your problem.

I think you want to put two constraint (UNIQUE constraint and foreign key constraint) in one column through XMLDB.

If you see properly last option.

there is showing "foreign-unique".

Key

You can select both key on one time.

I hope it is helpful.