Chess Lectures
unread,Mar 31, 2023, 10:16:17 AM3/31/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
when we create a table in database , we create through models.py .
we migrate and apply the changes .
Issue arises as after creation of table -> i tried to add a coloum manually to the db , and wrote the col name in models.py and in views.py as it was a time field added, so
data was getting inserted in the database correctly as desired .
Note -> NO MIGRATIONS WERE APPLIED YET .
now I wanted to create a new col named say x , i wrote in models , views nd then applied migrations -> it started throwing error -> i stopped the creation of new colm .
i applied migrations again for checking if there is any issue -> it showed ypu have a unapplied migration that was related to the manuall chnage i had done .
so i tried migrating but it failed -> colm name already exists .
MY REQUEST -> ADD A FEAUTURE THAT CAN SYNCHRONISE THE MANUALL CHNAGES IN DATABASE WITH DJANGO ORM .
SO we dont fall in the migration error -> it by default migrates when we make manuall chnages in the database .
if my request is valid , let me know for any solutions, if it not valid ,please still let me know why ?
Thank you in advance