Friday, March 31, 2017

Re: Adding fields in model, migrating a sqlite.db in production...good idea?

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.

2017-03-31 19:19 GMT+02:00 kalinski <kalinski@amei.se>:
> 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
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d67d940b-b6ce-49f5-902a-aae14ed174d3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTZzS6BEhsw4WQtdMc8gY-Lt27xGWyPTDmMO2WxMAC6Y8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment