--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
If you use Nicolas' dbadmin then the @:index metadata creates the necessary constraints on your MySQL tables.
If you have those constraints (you can also add them manually or with phpmyadmin also) then you get runtime errors you can catch if there are duplicate records
For usage:
As a fallback, you can always use TableCreate to set up your tables, and a tool like phpmyadmin to add the constraints manually, though DBAdmin does detect changes to your models and offer to make those changes to the database, which is pretty handy.
@:index(field1,field2,...,[unique])
: declare an index consisting of the specified classes fields - in that order. If the last field is unique
then it means that's an unique index (each combination of fields values can only occur once)--