Adding fields in model, migrating a sqlite.db in production...good idea?
13 views
Skip to first unread message
kalinski
unread,
Mar 31, 2017, 1:19:02 PM3/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original 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
Hello, I have a sqlite db that already holds important production data. Well same time I am developing that application adding functions while I need them. Well I know not exactly best practice. Now I need to add two fields to a model (boolean and char), I want to makemigrations, git add, git commit, git push Is there any risk of loosing part of the sqlite database here? Or can I just backup the sqlite file, try to migrate and all the data plus the new empty fields will be there? If someone with better knowledge can just say "yes should be working"? Many thanks! Martin
ludovic coues
unread,
Mar 31, 2017, 1:47:30 PM3/31/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original 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...@googlegroups.com
Make a copy of your sqlite file and try makemigration on your copy.
Everything should go smoothly. If that's the case, you can now use
your copy as your new production database.
As a side note, I don't think using an sqlite database is bad
practice. It make it super easy to backup your data.