vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I need to add a constraint in some columns that aren't a FK or PK. I've already looked for it in the documentation but I haven't found yet. A constraint like this: constraint DontPlayAgainstYourself hometeam <> awayteam -- wallace reis |
| |||
| Hi, Column level constraints aren't supported by MySQL, yet (at least not directly), they are supposed to be implemented in MySQL 5.1, as far as I know. However, it's possible to use triggers to emulate column level constraints. Markus |
| ||||
| wallace reis wrote: > I need to add a constraint in some columns that aren't a FK or PK. I've > already looked for it in the documentation but I haven't found yet. > > A constraint like this: > > constraint DontPlayAgainstYourself > hometeam <> awayteam > > -- > wallace reis You can't add check constraints in MySQL (yet), but there are two workarounds for that. Here are two links to get ypu started. http://www.livejournal.com/users/arjen_lentz/49881.html http://gilfster.blogspot.com/2005/11...-mysql-50.html ciao gmax -- _ _ _ _ (_|| | |(_|>< _| http://gmax.oltrelinux.com |