mitchellvanw / laravel-doctrine

NO LONGER MAINTAINED! A Doctrine 2 implementation that melts with Laravel
MIT License
187 stars 74 forks source link

Sqlite memory database vs migrations #81

Closed leonardoalifraco closed 9 years ago

leonardoalifraco commented 9 years ago

Hi,

I tried to switch to an sqlite in memory database for my tests, but after running my migrations, laravel-doctrine does not found any of the tables created by the migrations. I suppose that is because the migrations were made with the Laravel Schema::create Facade, which uses another sqlite connection, and in memory databases are per connection.

I was wondering then how should i architect my migrations and seeds in order to be made with the same connection that laravel-doctrine will use.

kirkbushell commented 9 years ago

You cannot use laravel migrations with laravel-doctrine. You either use doctrine, or you use laravel's schema builder. It will be two separate connections no matter what you do.

leonardoalifraco commented 9 years ago

Can i use doctrine migrations? I see that laravel-doctrine package requires doctrine/migrations.

Is there any doc on how to use it?

kirkbushell commented 9 years ago

That's what we ended up doing, but instead just ensuring that doctrine was aware of our entities and it would basically do a diff anytime an entity spec changed.

kirkbushell commented 9 years ago

Closing this for now. There's also a PR somewhere that does seem to support laravel migrations with a doctrine connection, which may resolve this issue.