Now maybe I'm getting this wrong but here's my story :
Today, i decide to get the code that I've been writing in an uncontrolled manner on the production server to a gitlab repository.
So I create the repository on gitlab and push my code using
git init
git add .
git commit -m "message"
git remote add origin https://gitlab.com/xxxxxx
git branch -M master
git push -uf origin master
A few hours later I notice my django webapp is down and when i check in the error logs, it coincides roughly with the work I was doing on gitlab
The error message I get is
2023-08-08 21:26:31,218: Error running WSGI application
2023-08-08 21:26:31,226: django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
I reinstalled the module with
pip3 install psycopg2
Then i get the error message
psycopg2.errors.UndefinedTable: relation "app_pageview" does not exist
LINE 1: ..."app_pageview"."url", "app_pageview"."count" FROM "app_pagev...
pageview is a middleware I create to log the number of pageviews per page to the database
I have a look in the database with
python3 manage.py dbshell
\dt
and I see that there are no tables relating to the pageviews in the database
So I think , maybe if I see what is going on with the migrations
python3 manage.py migrate --plan
and this gives an error message
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency app.0001_initial on database 'default'
And at this point I say, time to ask questions before I cause some serious damage as I don't really know what I'm doing
You can see the error message on https://www.clare-energy.ie
many thanks if you have some pointers
/ Colm