horilla icon indicating copy to clipboard operation
horilla copied to clipboard

I have updated to the new version. and I have the old database. The program don't work.

Open edmir31 opened this issue 1 year ago • 12 comments

I have updated to the new files. and I have the old database. My site gives me this error.

OperationalError at / no such column: base_employeeshiftschedule.is_auto_punch_out_enabled Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 4.2.11 Exception Type: OperationalError Exception Value: no such column: base_employeeshiftschedule.is_auto_punch_out_enabled Exception Location: C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\db\backends\sqlite3\base.py, line 328, in execute Raised during: horilla.decorators.wrapped_view Python Executable: C:\Users\User\AppData\Local\Programs\Python\Python312\python.exe Python Version: 3.12.3 Python Path: ['C:\Users\User\Desktop\horilla2024\horilla', 'C:\Users\User\AppData\Local\Programs\Python\Python312\python312.zip', 'C:\Users\User\AppData\Local\Programs\Python\Python312\DLLs', 'C:\Users\User\AppData\Local\Programs\Python\Python312\Lib', 'C:\Users\User\AppData\Local\Programs\Python\Python312', 'C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages'] Server time: Wed, 04 Sep 2024 14:53:31 +0530

Request Method: GET
http://127.0.0.1:8000/
4.2.11
OperationalError
no such column: base_employeeshiftschedule.is_auto_punch_out_enabled
C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\db\backends\sqlite3\base.py, line 328, in execute
horilla.decorators.wrapped_view
C:\Users\User\AppData\Local\Programs\Python\Python312\python.exe
3.12.3
['C:\Users\User\Desktop\horilla2024\horilla', 'C:\Users\User\AppData\Local\Programs\Python\Python312\python312.zip', 'C:\Users\User\AppData\Local\Programs\Python\Python312\DLLs', 'C:\Users\User\AppData\Local\Programs\Python\Python312\Lib', 'C:\Users\User\AppData\Local\Programs\Python\Python312', 'C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages']
Wed, 04 Sep 2024 14:53:31 +0530

edmir31 avatar Sep 04 '24 09:09 edmir31

Hi @edmir31 , Can you please share the content of the last migration file in the base app?

With Regards, Team Horilla

horilla-opensource avatar Sep 04 '24 09:09 horilla-opensource

@edmir31 Have you applied necessary migrations after updating the files?

  1. python manage.py makemigrations
  2. python manage.py migrate

centaurusgod avatar Sep 06 '24 02:09 centaurusgod

@edmir31 Have you applied necessary migrations after updating the files?

  1. python manage.py makemigrations
  2. python manage.py migrate

Yes i have done theme. Some tables have missing columns.

base_employeeshiftschedule.is_auto_punch_out_enabled base_rotatingworktypeassign.additional_data base_rotatingshiftassign.additional_data base_rotatingworktypeassign.additional_data

Can I add them manually.

edmir31 avatar Sep 06 '24 06:09 edmir31

Hi @edmir31 , Can you please share the content of the last migration file in the base app?

With Regards, Team Horilla

I have done. python manage.py makemigrations python manage.py migrate

Some tables have missing columns. base_employeeshiftschedule.is_auto_punch_out_enabled base_rotatingworktypeassign.additional_data base_rotatingshiftassign.additional_data base_rotatingworktypeassign.additional_data

Can I add them manually in the database. I'm using sqlite.

edmir31 avatar Sep 06 '24 06:09 edmir31

Hi @edmir31 , Directly adding the tables to the database is not suggested as it might cause issues with the migrations. It's better to add the missing table details in the last migration file of the base and run the migrate command.

horilla-opensource avatar Sep 06 '24 06:09 horilla-opensource

Hi @edmir31 , Directly adding the tables to the database is not suggested as it might cause issues with the migrations. It's better to add the missing table details in the last migration file of the base and run the migrate command.

Hi @horilla-opensource Can you explain how can i check using migration what tables and columns are missing. And where to check. I have found the missing tables by the errors.

edmir31 avatar Sep 06 '24 13:09 edmir31

This was also happening to us, we're using 1.2.0 and want to trying the Master branch with latest changes, when starting the apps there was no migration applied but cannot accessing the web because some columns are missing, is there any work around?

stevenfamy avatar Sep 09 '24 03:09 stevenfamy

Hi @edmir31 , Directly adding the tables to the database is not suggested as it might cause issues with the migrations. It's better to add the missing table details in the last migration file of the base and run the migrate command.

Hi @horilla-opensource Can you explain how can i check using migration what tables and columns are missing. And where to check. I have found the missing tables by the errors.

Hi @edmir31 , Sorry for the late reply. Please check the missing model names inside the migrations file we mentioned above and comment that section. After that run the migrate command. Once migrated, run the makemigrations and migrate command again.

With Regards, Team Horilla

horilla-opensource avatar Sep 09 '24 07:09 horilla-opensource

This was also happening to us, we're using 1.2.0 and want to trying the Master branch with latest changes, when starting the apps there was no migration applied but cannot accessing the web because some columns are missing, is there any work around?

Hi @stevenfamy , Can you specify in which model you are having the issue? Can you please share the error logs?

With Regards, Team Horilla

horilla-opensource avatar Sep 09 '24 07:09 horilla-opensource

This was also happening to us, we're using 1.2.0 and want to trying the Master branch with latest changes, when starting the apps there was no migration applied but cannot accessing the web because some columns are missing, is there any work around?

Hi @stevenfamy , Can you specify in which model you are having the issue? Can you please share the error logs?

With Regards, Team Horilla

Hi thanks for the reply, the errors was the same as @edmir31 missing columns base_employeeshiftschedule.is_auto_punch_out_enabled

stevenfamy avatar Sep 09 '24 09:09 stevenfamy

When i roon the migration comand it says.

My migartion files : https://gofile.io/d/MHZFs5

manage.py makemigrations No changes detected

manage.py migrate Operations to perform: Apply all migrations: admin, asset, attendance, auditlog, auth, base, biometric, contenttypes, django_apscheduler, employee, helpdesk, horilla_audit, horilla_automations, horilla_documents, horilla_views, leave, notifications, offboarding, onboarding, payroll, pms, recruitment, sessions Running migrations: No migrations to apply.

Nothing changes.

I see i have some rows and some tables differently in my old database old database 302 tables new database 317 tables. I there way to update the old database to the new.

edmir31 avatar Sep 09 '24 20:09 edmir31

Hi @edmir31 @stevenfamy , Can we connect with our team on skype if possible to discuss further on this issue? Please connect with us on skype at [email protected] or [email protected].

horilla-opensource avatar Sep 10 '24 04:09 horilla-opensource

Hi @edmir31 , We are closing this issue due to inactivity. It seems that there hasn't been any recent activity or discussion, and we believe it may have been resolved or is no longer relevant. If you feel this issue is still important and should be addressed, please feel free to reopen it or create a new issue with updated details.

With Regards, Team Horilla

horilla-opensource avatar Nov 22 '24 09:11 horilla-opensource