joomla / framework.joomla.org

Application powering the internet home of the Joomla! Framework
https://framework.joomla.org
GNU General Public License v2.0
36 stars 30 forks source link

Run vendor/bin/phinx migrate to set up the database - not working #51

Closed Perino01 closed 3 years ago

Perino01 commented 4 years ago

According to the installation guide the setup is not working!

Installation: Step 4: Run vendor/bin/phinx migrate to set up the database

Error: Call to undefined method Phinx\Db\Adapter\TimedOutputAdapter::getAdapterTableName()

there is no method getAdapterTableName() in Phinx\Db\Adapter\TimedOutputAdapter!

So database setup is not working!

mbabker commented 4 years ago

Can't duplicate. The migrate command is working just fine for me.

Please provide a full stack trace for the issue. You may have run into a bug with the upstream Phinx library, not something that could be fixed in this application.

Perino01 commented 4 years ago

I did the installation two times and there is no method "getAdapterTableName()" in the TimedOutputAdapter nor in the whole project!

Where do you have the method "getAdapterTableName()" which is called by TimedOutputAdapter::getAdapterTableName() in one of the migration scripts?

mbabker commented 4 years ago

That method is not directly called inside our application code, it is used inside the Phinx library and does exist in another adapter.

Again, you might have run into a bug with the Phinx library. I don’t have a way to confirm or deny this though because I can’t reproduce your issue to begin with.

On Mon, Jan 13, 2020 at 12:00 AM Perino01 notifications@github.com wrote:

I did the installation two times and there is no method "getAdapterTableName()" in the TimedOutputAdapter nor in the whole project!

Where do you have the method "getAdapterTableName()" which is called by TimedOutputAdapter::getAdapterTableName() in one of the migration scripts?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/joomla/framework.joomla.org/issues/51?email_source=notifications&email_token=AACZ7IKA54B5OQSBLHKAZCLQ5P7OJA5CNFSM4KFYFGH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIXTMGY#issuecomment-573519387, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACZ7IPEWDAE5RF2BFW5UILQ5P7OJANCNFSM4KFYFGHQ .

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
spaethj commented 4 years ago

The file, etc/migrations/20170717031439_release_package_key.php, generate SQL request like this:

ALTER TABLE myprefix_releases ADD FOREIGN KEY (package_id) REFERENCES myprefix_myprefix_packages (id);

After REFERENCES, the prefix is added twice.

To resolve this issue, go to ligne 31 and replace

->addForeignKey('package_id', $this->getAdapter()->getAdapterTableName('packages'), ['id'])

by ->addForeignKey('package_id', 'packages', ['id'])

walleralexander commented 4 years ago

The file, etc/migrations/20170717031439_release_package_key.php, generate SQL request like this:

ALTER TABLE myprefix_releases ADD FOREIGN KEY (package_id) REFERENCES myprefix_myprefix_packages (id);

After REFERENCES, the prefix is added twice.

To resolve this issue, go to ligne 31 and replace

->addForeignKey('package_id', $this->getAdapter()->getAdapterTableName('packages'), ['id'])

by ->addForeignKey('package_id', 'packages', ['id'])

That worked perfectly! Thank you.