Hello there again,
Ok, I've developed a fairly intricate model by now, and I'm preparing to go into development with the generated database.
Problem - As far as I can tell, the Sql Server schema (not the "database schema", but the sql server specific concept of "schema") for the generated objects is unique per model, and is set to be the value of the model's "Name" property. So, all the tables end up belonging to this single schema in the created database. I tried to read up on Groups but I can't figure what they're meant for, and didn't find a way to specify the table's schema though them either.
The problem obviously is, we need tables and other dbobjects to be generated within multiple schemas inside the same database to be able to use this Sql Server feature productively. IF there will be only one schema per model, then I guess we'll need to wait until we can import entities from external models. If not, I have a hope that, maybe, there's some way to change the schema for at least some of the tables? Even if that means manually editing the .orm file or something of the kind?
Question - What approach do you recommend to upgrade existing databases once the model has been modified? I'll be trying to do this using... "Visual Studio Team System 2008 Database Edition" projects, which enable to compare database schemas, etc... is there any other way currently? If not, it would be interesting exploring the possibility of adding some kind of integration between NORMA and VS Team Database Edition projects, which I believe enable to change the database schema without losing existing data in the tables.It might be as simple as generating the sql file in the project's folder, or copying it to the correct folder so the sql server project can catch up from there.
Minor request - Once the database has been created, it would be useful to at least have the generated .sql file include DROP statements for each contraint and table, or to be able to specify which table/s to generate the drop/create table statements for, so there's no need to manually drop the tables (which can become burdensome when there are lot's of FKs between the tables).
Workaround: (for Sql Server 2008) To drop all tables in the current database, in Sql Server Management Studio, select the Tables node for the database in Object Explorer, press F7 (or View, Object Explorer Details), select all the tables, select "Script Table for..." from the right click menu, DROP to > New query window. Execute.