This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, To reproduce the issue. Create a new SQL Server database and a LightSpeed model. Add a couple of entities on the design surface and set the connection string to that of the newly created database. Select "Update Database" from the design surface context menu. Observe that it creates the entities but it does not create and initialize the "KeyTable" table. I was expecting the table to be created with initial values (similiar to what happens when you run migrations). Am I missing something? Thanks, Werner
|
|
|
You are not missing anything. We do not offer to create the KeyTable because many customers do not use KeyTable, and it would be annoying for them to keep having us suggest it to them. (The reason we are able to insert a KeyTable creation call in migrations is that we can detect when we are generating an initial migration. If a user doesn't want to use KeyTable, they can delete that call from the generated code for the initial migration, and it won't reappear. This isn't possible when syncing directly to a database because we don't know whether this is the first sync.) |
|
|
Hi Ivan, I'm perplexed by this. This is how I understand it. Each entity has its own "Identity Method". By default its "Default", meaning its going to use the method as defined by the LightSpeedContext. Migrations use the default is KeyTable and that is why KeyTable is generated as part of the initial migration. In your documentation you recommend to use the configuration file. The "Identity Method" of entities impact migrations and many more parts of the application. I can't see a use case where I'd like to change that at runtime as it almost always will require changes to code, database or both. Thus, having an entity defer its "Identity Method" to the LightSpeedContext configuration doesn't make sense. This is the root of my confusion. Despite some minor issues, I'm impressed with LS4. It has a lot of potential.
Thanks, Werner
|
|