Re: [Firebird-net-provider] EF Migrations

2015-01-13 Thread Mercea Paul
On 2014.11.06 3:06 PM, Jiří Činčura wrote: > Hi *, > > Anybody here willing to give EF Migrations a try? I'm getting close to first > implementation. > First error i got when i enable migrations: "Checking if the context targets an existing database... No MigrationSqlGenerator found for provider

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
> I'd like to do this. But when I register it in provider services, it does > not work. Not sure why. Ahh. Finally found it. IdbInterceptors are not supported for registration in DbProviderServices. So we're probably left with only DbInterception.Add. I did some research and looks it should work

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
> One more question, how can I register custom implementation of > IFbMigrationSqlGeneratorBehavior? Register MigrationSqlGenerator with FbMigrationSqlGenerator and pass the implementation to ctor. Something like: AddDependencyResolver(new SingletonDependencyResolver>(() => new FbMigrationSqlGe

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
> or maybe via AddDependencyResolver(new > SingletonDependencyResolver()) as suggested in > documentation: http://msdn.microsoft.com/ru- > ru/library/system.data.entity.dbconfiguration.addinterceptor(v=vs.113).asp > x), I'd like to do this. But when I register it in provider services, it does not

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
One more question, how can I register custom implementation of IFbMigrationSqlGeneratorBehavior? On Tue, Dec 30, 2014 at 12:55 PM, Геннадий Забула wrote: > According to this: > http://entityframework.codeplex.com/wikipage?title=Interception > As I understand DbConfiguration.AddInterceptor is for

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
According to this: http://entityframework.codeplex.com/wikipage?title=Interception As I understand DbConfiguration.AddInterceptor is for context instance interceptions. And DbInterceptors.AddInterceptor is for global-wide interceptions. I suggest moving registration MigrationsTransactionsIntercepto

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
Yeah, but it’s different path. The InternalConfiguration class might or might not like that (now or in the future). It’s problem waiting to happen. And please stop sending HTML emails. -- Mgr. Jiří Činčura Independent IT Specialist --

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
> That’s not the same as what AddInterceptor call does. As far as I see in the debugger, MigrationsTransactionsInterceptor is called successfully and failed tests are going further. I've added just one fix to filter just Firebird connections: public void BeginningTransaction(DbConnection connection

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
The name for index is created by EF if the explicit value is not provided. -- Mgr. Jiří Činčura Independent IT Specialist -- Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and d

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
That’s not the same as what AddInterceptor call does. -- Mgr. Jiří Činčura Independent IT Specialist From: Геннадий Забула [mailto:zabulu...@gmail.com] Sent: Tuesday, December 30, 2014 10:36 AM To: For users and developers of the Firebird .NET providers Subject: Re: [Firebird-net-provider] EF

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
One more thing about naming indexes conventions. Indexes namespace is global. So if you have several same fields in different tables, you'll have the same name index for both. Good example in three entities with N:M relations: Entity1: eid, name Entity2: eid, name Entity3: eid, name Entity1Entity3:

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
And looks like it works: public FbProviderServices() { #if (EF_6) AddDependencyResolver(new SingletonDependencyResolver(new FbConnectionFactory())); AddDependencyResolver(new SingletonDependencyResolver>(() => new FbMigrationSqlGenerator(), ProviderInvariantName)); System.Data.Entity.Infrastructur

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
I've found out that there is the static class: System.Data.Entity.Infrastructure.Interception.DbInterception, which adds IDbInterceptor, 2014-12-30 11:23 GMT+02:00 Jiří Činčura : > > I'm using the same Context for both MSSQL and Firebird, how deriving > from FbDbConfiguration can affect MSSQL cod

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
> I'm using the same Context for both MSSQL and Firebird, how deriving from > FbDbConfiguration can affect MSSQL code path? Can we override this somehow > just in Firebird provider? You can use the same context. It's just configuration. I'm waiting for reply from EF guys to see what other optio

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
transaction and you need to insert into __MigrationHistory right after > creation. Disaster. > > -- > Mgr. Jiří Činčura > Independent IT Specialist > > From: Геннадий Забула [mailto:zabulu...@gmail.com] > Sent: Tuesday, December 30, 2014 8:19 AM > To: For users and developers o

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
From: Геннадий Забула [mailto:zabulu...@gmail.com] Sent: Tuesday, December 30, 2014 8:19 AM To: For users and developers of the Firebird .NET providers Subject: Re: [Firebird-net-provider] EF Migrations Fall in next query: EXECUTE BLOCK AS BEGIN EXECUTE STATEMENT 'CR

Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
> 1. Generator ID. One for all is bad options for me. I'll reimplement it to > have one for table. That's why it's open. > 2. Couple of errors in creating Constraints or Indexes: "unsuccessful metadata update Name longer than database column size" Constraint names are longer than it can be in sy

Re: [Firebird-net-provider] EF Migrations

2014-12-29 Thread Геннадий Забула
Fall in next query: EXECUTE BLOCK AS BEGIN EXECUTE STATEMENT 'CREATE TABLE "__MigrationHistory" ( "MigrationId" VARCHAR(150) NOT NULL, "ContextKey" VARCHAR(300) NOT NULL, "Model" BLOB SUB_TYPE BINARY NOT NULL, "ProductVersion" VARCHAR(32) NOT NULL )' WITH AUTONOMOUS TRANSACTION; END Parameters: Wit

Re: [Firebird-net-provider] EF Migrations

2014-12-29 Thread Геннадий Забула
Here are my issues/suggestions: 1. Generator ID. One for all is bad options for me. I'll reimplement it to have one for table. 2. Couple of errors in creating Constraints or Indexes: "unsuccessful metadata update Name longer than database column size" Constraint names are longer than it can be in s

Re: [Firebird-net-provider] EF Migrations

2014-12-19 Thread Mercea Paul
On 2014.11.06 3:06 PM, Jiří Činčura wrote: > Hi *, > > Anybody here willing to give EF Migrations a try? I'm getting close to first > implementation. > I'm trying to add support for Firebird db for existing app on SQL Express, and, first run of the application was with no errors and created the

Re: [Firebird-net-provider] EF Migrations

2014-11-13 Thread Геннадий Забула
Don't have enough time to merge and test it. I look forward to test it and write some feedback on next week. 2014-11-13 18:31 GMT+02:00 Jiří Činčura : > Except for "identity" generation should be "done": http://ge.tt/3OSvoR42 . > > Some feedback? > > -- > Mgr. Jiří Činčura > Independent IT Specia

Re: [Firebird-net-provider] EF Migrations

2014-11-13 Thread Jiří Činčura
Except for "identity" generation should be "done": http://ge.tt/3OSvoR42 . Some feedback? -- Mgr. Jiří Činčura Independent IT Specialist -- Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month.

Re: [Firebird-net-provider] EF Migrations

2014-11-11 Thread Jiří Činčura
> Exactly. I'm currently planning to investigate whether EF allows adding 3rd > party services/interfaces to be resolved. And how clean that looks like. OK, so this is not a way. Not only the "resolver" is not acessible it's also DbConfiguration related not DbMigrationsConfiguration. Maybe it's

Re: [Firebird-net-provider] EF Migrations

2014-11-11 Thread Jiří Činčura
And BTW does anybody has some detailed information about "Although this form of EXECUTE STATEMENT can also be used with all kinds of DDL strings (except CREATE/DROP DATABASE), it is generally very, very unwise to use this trick in order to circumvent the no-DDL rule in PSQL.", which I'm using to

Re: [Firebird-net-provider] EF Migrations

2014-11-10 Thread Jiří Činčura
So anybody tested migrations? -- Mgr. Jiří Činčura Independent IT Specialist -- Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push n

Re: [Firebird-net-provider] EF Migrations

2014-11-09 Thread Геннадий Забула
I've asked about mutual exclusive of schemes. If schemes can be applied in one model you can use custom attributes on primary keys. If schemes are mutual exclusive, you can use custom extension method for model builder. 2014-11-09 13:12 GMT+02:00 Jiří Činčura : > > The update script should not be

Re: [Firebird-net-provider] EF Migrations

2014-11-09 Thread Jiří Činčura
> The update script should not be changed by users generated by migration. Or > maybe I don't know something? Not exactly. There's assumption that the script will not be mostly changed. But some DBA in some "classic" environments might change it. > We need to inject some implementation through

Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Геннадий Забула
> It kind of breaks the notion of altering the table/column with one command. It's a bit of magic with system tables and people might get confused or break it by chaning the script. The update script should not be changed by users generated by migration. Or maybe I don't know something? > MSSQL has

Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Jiří Činčura
> 1. What problem in Execute block? It kind of breaks the notion of altering the table/column with one command. It's a bit of magic with system tables and people might get confused or break it by chaning the script. > 2. My opinion for "Identity" is to copy MSSQL behavior. Create generator for

Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Геннадий Забула
Can you provide it on github, so I can patch my copy of FB library to use in our project? 1. What problem in Execute block? 2. My opinion for "Identity" is to copy MSSQL behavior. Create generator for each primary key + trigger before insert. 2014-11-08 14:38 GMT+02:00 Jiří Činčura : > Great. H

Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Jiří Činčura
Great. Here's http://ge.tt/2Cx9f142?c early implementation. There are two issues which I'm not sure how to do (see below). Rest should work. But there might be some missing space etc. in generated SQL or I might wrote it in different engine's dialect. That's what I'm mostly looking for for this

Re: [Firebird-net-provider] EF Migrations

2014-11-06 Thread Mercea Paul
On 2014.11.06 3:06 PM, Jiří Činčura wrote: > Hi *, > > Anybody here willing to give EF Migrations a try? I'm getting close to first > implementation. > I'm in. Paul MERCEA ___ --

Re: [Firebird-net-provider] EF Migrations

2014-11-06 Thread Геннадий Забула
Sure, waiting for this. 2014-11-06 15:06 GMT+02:00 Jiří Činčura : > Hi *, > > Anybody here willing to give EF Migrations a try? I'm getting close to > first implementation. > > -- > Mgr. Jiří Činčura > Independent IT Specialist > > > ---

[Firebird-net-provider] EF Migrations

2014-11-06 Thread Jiří Činčura
Hi *, Anybody here willing to give EF Migrations a try? I'm getting close to first implementation. -- Mgr. Jiří Činčura Independent IT Specialist -- ___ Firebird-net-provider