While eagerly awaiting direct support for UNIQUE constraints in EF’s CodeFirst (going against SQL2k8R2), I am currently running a SQL Script that does the ALTER TABLE ADD CONSTRAINT after CF creates the DB for me.
I would like to somehow programmatically add these UNIQUE constraints right after CF creates the schema, maybe via ALTER TABLE?
Im thinking of maybe doing it in the Seed() override somehow?
Possible?
You can setup a Database Initializer to create constraints.