laravel-doctrine icon indicating copy to clipboard operation
laravel-doctrine copied to clipboard

Added support for Laravel Migrations & Reminders

Open neon64 opened this issue 10 years ago • 10 comments

Doctrine automatically updates the database schema to represent the entities in your application, thus rendering most of the use-cases for Laravel's migrations useless, however Laravel's migrations can still be useful for migrating other stuff, such as data stored on the filesystem.

What's Changed

This pull request adds support for Laravel migrations, using Doctrine for the DB interaction. It adds a new Entity: Migration, that is automatically included into the metadata config. It also adds a new implementation of MigrationRepositoryInterface that uses Doctrine instead of Laravel's DB.

I've also added support for Laravel's password reminders.

Caveats:

  • Switching connections doesn't work (perhaps you might know how to fix it?)
  • The Migration entity cannot be removed (perhaps I should add a config option)

It'd be great to know what you think about this, and if it is a good fit for your package.

neon64 avatar Dec 06 '14 03:12 neon64

This is excellent. Will test it out when I get home.

kirkbushell avatar Dec 06 '14 10:12 kirkbushell

I found a bug with the getRan() method. It should work better now.

neon64 avatar Dec 06 '14 22:12 neon64

I've added support for password reminders as well. Let me know if you'd prefer that in a seperate PR.

neon64 avatar Dec 11 '14 06:12 neon64

:+1:

jonesio avatar Jan 16 '15 13:01 jonesio

There's some comments in some of the code that can be removed - and please write tests for the new features.

kirkbushell avatar Jan 26 '15 17:01 kirkbushell

@neon64 ping!

kirkbushell avatar Jan 28 '15 12:01 kirkbushell

I've been without stable internet for a couple of days but I'll try to get those fixes done asap.

neon64 avatar Jan 29 '15 03:01 neon64

What comments did you want removed? I could only find the // not implemented one in DoctrineMigrationRepository plus a bunch of docblocks, which I assume you want kept.

neon64 avatar Jan 29 '15 04:01 neon64

I tried running the existing tests and they failed. Fatal error: Call to undefined method Mitch\LaravelDoctrine\Configuration\SqliteMapper::isAppropriate() in /Users/chris/Web/Personal/Oxygen/workbench/mitchellvanw/laravel-doctrine/tests/Configuration/SqliteMapperTest.php on line 19 I changed the calls to `isAppropriate` to `isAppropriateFor` and now the following test fails Tests\Configuration\SqliteMapperTest::testMapping Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array ( 'driver' => 'pdo_sqlite' - 'path' => 'path/database/db.sqlite' + 'path' => 'db' 'user' => 'somedude' + 'password' => null )

Sorry. I forgot to merge new changes from upstream. The tests are fine now

neon64 avatar Jan 29 '15 04:01 neon64

:+1:

FoxxMD avatar Apr 28 '15 14:04 FoxxMD