Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from version 1.0 to 2.0 gives error related to table name. #75

Closed
hkdemiralp opened this issue Dec 25, 2023 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@hkdemiralp
Copy link

hkdemiralp commented Dec 25, 2023

Hi. I tried to update from version 1.0 to 2.0 but now it doesn't work. I upgraded with these method:
1- First git clone the repo,
2- Edit the config/environment.php,
3- Copy old saved_qrcode directory to new place.
4- Adjusted apache vhost file, (document root changed from qrcode to src)
5- Run upgrade/upgrade.php. It gave the following output.

Upgrading from version 1.0 to a version >= 2.0.
The admin_accounts table has been renamed to users successfully.
The user_name column has been renamed to username successfully.
The admin_type column was renamed to type successfully.
The id_owner column has been added to dynamic_qrcodes successfully.
The id_owner column has been added to static_qrcodes successfully.

I get login screen. But after I login I get this error:

Fatal error: Uncaught mysqli_sql_exception: Table 'qrtest.qr_qr_dynamic_qrcodes' doesn't exist in /var/www/html/qrcode/src/lib/MysqliDb/MysqliDb.php:1988 Stack trace: #0 /var/www/html/qrcode/src/lib/MysqliDb/MysqliDb.php(1988): mysqli->prepare() #1 /var/www/html/qrcode/src/lib/MysqliDb/MysqliDb.php(1594): MysqliDb->_prepareQuery() #2 /var/www/html/qrcode/src/lib/MysqliDb/MysqliDb.php(738): MysqliDb->_buildQuery() #3 /var/www/html/qrcode/src/lib/MysqliDb/MysqliDb.php(764): MysqliDb->get() #4 /var/www/html/qrcode/src/index.php(29): MysqliDb->getOne() #5 {main} thrown in /var/www/html/qrcode/src/lib/MysqliDb/MysqliDb.php on line 1988

NOTE 1: Now table name is "qr_dynamic_qrcodes" in database. But the error message looks for "qr_qr_dynamic_qrcodes".
In config/environment.php file it is like this: define('DATABASE_PREFIX', "qr_");
NOTE 2: If I delete the tables and run install/setup.php, it gives the same error.
NOTE 3: If I create "qr_qr_dynamic_qrcodes" table and then copy everything into it from the table "qr_dynamic_qrcodes", Everything starts to work. But if I delete any of the table, it gave the same error.
What should I do?

@giandonatoinverso
Copy link
Owner

Hi this error is very strange because in the upgrade.php file all tables are renamed with prefix + table name. Then in the file environment.php file you have the same prefix so I can’t explain myself this. Now I tag this issue with bug label, thanks for report me.

@giandonatoinverso giandonatoinverso added the bug Something isn't working label Dec 27, 2023
@lukolb
Copy link

lukolb commented Dec 29, 2023

I'm having the exact same issue. And since there are now two different tables in use, there are quite a few bugs. Couldn't locate the problem yet.

@simenah
Copy link

simenah commented Feb 14, 2024

Any updates on this? Same issue here. Been looking through the code, and I'm having a hard time locating the reason for the bug.

@giandonatoinverso
Copy link
Owner

No sorry. Currently I haven’t time for working on this project

@simenah
Copy link

simenah commented Feb 15, 2024

No sorry. Currently I haven’t time for working on this project

Understood. Thanks for letting me know!

@giandonatoinverso
Copy link
Owner

Solved in the new release. Download the new code or use the latest docker image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants