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
|
Hi, Great feature, by the way, but just a couple of comments on the usability of it. Maybe there are better ways to make it work. First, it would be better IMHO, if the Migration ProviderType enum was the same as the DataProvider enum. Then I can use the DataProvider property on LightSpeedContext directly instead of have to convert between them. Second, Migrator.CurrentVersion blows up if the DBVersion table does not exist in the database. When starting from a clear database (which obviously has no tables), I have to catch the sql exception. The docs say "If no version information exists, it will be created and set to the default starting version number." which again INHO should create the table if is doesn't exist. Third, a way to capture the data might be nice, although, I not sure exactly how that would work. At least I can in code create a number of entities and add them, detecting which versions have been migrated to and adding them manually. And lastly, the whole process would be really great if I could programatically create the database in the first place (of course in a db provider independent way). Let me know your thoughts and whether I have just missed something with the above points. And again, very good feature. Peter Shoebridge
|
|
|
Thanks for the feedback and the kind words. We have fixed the issue where it blew up if you were hosting your own migrations and the DBVersion table didn't exist; this fix should be available in nightly builds with build number 12882. If you're still seeing the problem with a recent nightly then let us know and we'll investigate further. I'll take a look at whether we can merge the two ProviderType enums. I suspect the reasons for having two enums are largely historical at this point (dating back to the prehistory of the 2.0 designer). We didn't consider this for 3.0 because we weren't really expecting people to host their own migrations, but now we know different, we'll see if we can rationalise this (can't make any promises though). Could you say a bit more about what you mean by "a way to capture the data"? It sounds like you're talking about extracting and modifying the contents of the database rather than just the schema -- is that correct? Could you expand on the use case? Creating the database from scratch -- nice idea, at least for simpler or more convention-oriented databases like SQLite or SQL Server. For more complex databases like Oracle I think we would probably still want to leave this to the DBA. Anyway, I've logged a feature request for this and we'll definitely have a think about this. If we were to do this, which database engines would be the priority for you? Thanks again for the feedback! |
|
|
I am using build 3.0.1078.13186 and am still seeing the problem where calling CurrentVersion throws an error. I am using it against both MS SQL and PostgreSQL. My use case is this: we have a server product with either MS SQL or PostreSQL backend and I want to automate the initial database population as much as possible (and of course schema migrations). There is some amount of (minimal) initial data that needs to be present (most importantly of course the KeyTable entry) and before this feature we used a sql script to both create the schema and populate the data. We had to maintain two separate scripts, one for each database backend, and we hadn't really tackled the mirgration problem. I coded up the migration stuff using LS and manually wrote the KeyTable row and then create entities for the initial data and add them. It's still easier than maintaining 2 scripts. As for the database creation, I threw that one in just for grins. It would be nice as then we wouldn't need to set that up in advance. Thanks Peter |
|
|
Hmm, we're sorry to hear you're still seeing that problem, and we'll get it fixed for you as soon as possible. From your message I am assuming you're seeing the error on both SQL Server and PostgreSQL: can you just confirm that? Thanks! |
|
|
Ivan, Sorry for the delay in getting back to you. Yes, I can confirm that I am seeing the same problem with both MSSQL and PostgreSQL. Here are the debug outputs from running our server against each database. MSSQL 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mindscape.LightSpeed.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mindscape.LightSpeed.Migrations.dll' Server.DataModelMigrations.DataMigration: 2010-03-04 11:13:08,066 Server.DataModelMigrations.DataMigration[8] INFO : Running with LightSpeed version: 3.0.1078.13186 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mindscape.LightSpeed.Generator.Extraction.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Mindscape.LightSpeed.Generator.Integration.Dsl.Mapping\1.0.0.0__dabefdafd5f32554\Mindscape.LightSpeed.Generator.Integration.Dsl.Mapping.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Symbols loaded. 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Mindscape.LightSpeed.Generator.Model\1.0.0.0__dabefdafd5f32554\Mindscape.LightSpeed.Generator.Model.dll' A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll A first chance exception of type 'Mindscape.LightSpeed.Migrations.MigrationException' occurred in Mindscape.LightSpeed.Migrations.dll Migrator.CurrentVersion failed: The version table is not initialised correctly - it either does not exist or has no value.
PostgreSQL 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mindscape.LightSpeed.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mindscape.LightSpeed.Migrations.dll' Server.DataModelMigrations.DataMigration: 2010-03-04 11:23:47,181 Server.DataModelMigrations.DataMigration[10] INFO : Running with LightSpeed version: 3.0.1078.13186 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mindscape.LightSpeed.Generator.Extraction.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Mindscape.LightSpeed.Generator.Integration.Dsl.Mapping\1.0.0.0__dabefdafd5f32554\Mindscape.LightSpeed.Generator.Integration.Dsl.Mapping.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Symbols loaded. 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Npgsql.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Source\BY-Gaming\TerminalManager\TerminalManagerService\bin\Debug\Mono.Security.dll' 'BlueYonder.TerminalManager.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Mindscape.LightSpeed.Generator.Model\1.0.0.0__dabefdafd5f32554\Mindscape.LightSpeed.Generator.Model.dll' A first chance exception of type 'Npgsql.NpgsqlException' occurred in Npgsql.dll A first chance exception of type 'Npgsql.NpgsqlException' occurred in Npgsql.dll A first chance exception of type 'Mindscape.LightSpeed.Migrations.MigrationException' occurred in Mindscape.LightSpeed.Migrations.dll Migrator.CurrentVersion failed: The version table is not initialised correctly - it either does not exist or has no value. Regards Peter |
|