sqlpostgresql

I changed my Django App name and not DB names do not match


I am using Django and I wanted to change an app name from project to projects to make it cleaner and match the other models.

So, I did the usual Django stuff. Changed a config name, changed a config URL, changed an App folder name. Even changed the apps.py and the URLs to app_name = 'projects'.

The migrations went ok.

Issue is the database is still showing everything as project_*** in the database.

enter image description here

So now, I am getting errors like these:

** error relation "projects_overview" does not exist

LINE 1: SELECT "projects_overview"."a_id" FROM "projects_overview"

It wants the new "S".

how can I get the database to show the correct prefix of projects_ and not the old project_?

Will I have to use Postgres commands to change all the tables manually or did I miss some Django command.

DBs are not my thing, so very greatful for anyones kind help.


Solution

  • The table name you sould change accordingly. Something like

    alter table project_overview rename...

    ALTER TABLE

    project_overview
    

    RENAME TO

    projects_overview
    

    ;