uafrica / oauth-server

OAuth Server
Other
51 stars 51 forks source link

Namespace Issue on Initial Migration #30

Open csc1cec opened 8 years ago

csc1cec commented 8 years ago

Hey uafrica,

Thanks for this plugin! Looks great so far. I ran into a small namespacing issue while running my initial DB migration. Both 20150226071027_initial_migration.php and 20151029080800_change_owner_id_field.php threw "Fatal error: Class 'Migrations\AbstractMigration' not found in .

Being fairly new to Cake 3.0 and having only completed one other project in Cake 2, I simply searched for anything with the name "AbstractMigration" and came up with Phinx\Migration\AbstractMigration. A simple use statement at the top of each migration file seems to have fixed the issue. Of course, it always makes me nervous when modifying vendor libraries directly so I thought I'd let you know.

I'm using Cake 3.0.10. All tables seem to have been created successfully, but I guess I won't know for sure until I get everything up and running!

dakota commented 8 years ago

Hi @csc1cec, the oauth server plugin requires the CakePHP migrations plugin to work. That is the plugin that supplies the correct Migrations\AbstractMigration class. If you installed the plugin using compose (composer require uafrica/oauth-server) then the migrations plugin should have been automatically installed for you.

If you downloaded the files and added the plugin manually, then you'll need to manually install the migrations plugin too.

csc1cec commented 8 years ago

Hi @dakota, that's odd since I used composer to install.

Like I said, it seems adjusting the namespace solved the problem and all DB tables seem good to go. So no problem on my end. Just giving you guys a heads up there may be a bug lurking somewhere around migrations.

dakota commented 8 years ago

Thanks for the heads up.