Page 1 of 1
EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Fri 05 Jul 2013 17:58
by John Liu
Using package Manager console command
PM> Update-Database -verbose -script
the script generated by dotConnect for oracle includes a delimiter (/) to separate each command. if I use the following code to generate the script, the delimiter (/) is not included. Do we have a option to include the delimiter (/)?
var scriptor = new MigratorScriptingDecorator(migrator);
var scripts = scriptor.ScriptUpdate();
thanks
JL
PM> Update-Database -verbose -script
ALTER TABLE AZ.STVINSPECTION
MODIFY TVREASON NVARCHAR2(100) DEFAULT NULL
/
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE AZ.STVINSPECTION MODIFY TVREASON NULL';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE <> -1451 AND SQLCODE <> -1442 THEN
RAISE;
END IF;
END;
/
Re: EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Mon 08 Jul 2013 11:58
by Shalex
We have reproduced the issue and are investigating it. We will post here about the result.
Re: EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Wed 10 Jul 2013 12:40
by Shalex
The bug with using delimiter when generating Code-First Migrations script via the ScriptUpdate method of the MigratorScriptingDecorator class in Entity Framework 6 is fixed. We will notify you when the corresponding build of dotConnect for Oracle is available for download.
Re: EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Thu 18 Jul 2013 15:00
by Shalex
New version of dotConnect for Oracle 7.8 is released!
It can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to
http://forums.devart.com/viewtopic.php?f=1&t=27556.
Re: EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Mon 09 Sep 2013 16:41
by John Liu
I've installed EF6 RC1 and updated to dotConnect for oracle 7.9.322. I still have different issue with script generation. Everything works great inside PM. Both of the following two commands generate the exact SQL scripts as expected.
PM> update-database -targetmigration V1 -verbose -script
PM> update-database -verbose -script
I'm having an issue to generate the scripts programmatically. The following code generate an error. The same code works great with SQL Server provider.
var scriptor = new MigratorScriptingDecorator(migrator);
var scripts = scriptor.ScriptUpdate("0", "V1");
Requested value 'UpdateDatabaseOperation' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at System.Enum.Parse(Type enumType, String value)
at Devart.Common.Entity.Migrations.c.b(MigrationOperation A_0)
at Devart.Common.Entity.Migrations.e.a(MigrationOperation A_0)
at Devart.Common.Entity.Migrations.e.a(IEnumerable`1 A_0)
at Devart.Common.Entity.Migrations.b.a(IEnumerable`1 A_0, String A_1)
at Devart.Data.Oracle.Entity.Migrations.OracleEntityMigrationSqlGenerator.Generate(IEnumerable`1 migrationOperations, String providerManifestToken)
at System.Data.Entity.Migrations.DbMigrator.GenerateStatements(IList`1 operations, String migrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.GenerateStatements(IList`1 operations, String migrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorScriptingDecorator.ScriptUpdate(String sourceMigration, String targetMigration)
at Cw.DataAccess.DbMgrData.GenerateMigrationSqlScripts(String fromVersion, String toVersion) in c:\CWSource\Server\Cw.DataAccess\Migrations\DbMgrData.cs:line 340
JL
Re: EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Mon 09 Sep 2013 23:01
by John Liu
I changed the code from
var scriptor = new MigratorScriptingDecorator(migrator);
var scripts = scriptor.ScriptUpdate("0", "V1");
to
var scripts = scriptor.ScriptUpdate(null, "V1");
Then, It starts to work correctly now.
by the way, thanks for adding '/' to seperate each command that makes my life easier.
but it adds too many '/r/n', I have to remove some of them
thanks
JL
Re: EF6 Beta 1 Code First Migration Script Generation Issue
Posted: Thu 12 Sep 2013 10:15
by MariiaI
Glad to see that the issue was resolved.
but it adds too many '/r/n', I have to remove some of them
We will consider this behavior.
If you have any further questions, feel free to contact us.