New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I run Makemigrations on model changes? #334

Closed
mercycoach opened this Issue Jun 7, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@mercycoach
Copy link

mercycoach commented Jun 7, 2015

I'm trying to make changes in my model ( and therefore db ) without losing any existing data. Is there any way to do that in the PTVS interface?

@zooba

This comment has been minimized.

Copy link
Member

zooba commented Jun 8, 2015

Do you mean in Django? (We aren't a purely Django-focused IDE, so it helps to clarify which library/framework you're talking about.)

We don't have anything specific for Django to migrate to a new schema, though there is plenty out there to help. If you can run commands from a Django management shell then there is a command to bring that up if you right-click your project and select Python, and if you look in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\12.0\Python Tools\Microsoft.PythonTools.Django.targets you'll see how we implemented those commands so you can add your own (either to that file, to your own .targets file that you then <Import> in your project, or directly to your .pyproj file).

@krisavi

This comment has been minimized.

Copy link

krisavi commented Aug 6, 2015

Hello,

I tried to edit that file, I have it included in the .pyproj but it doesn't seem to make those lines to appear for me. For some reason it is not like updating the commands there, I tries to change even syncDB, but when I run it, then it still runs the old syncDB command.

@zooba

This comment has been minimized.

Copy link
Member

zooba commented Aug 6, 2015

Make sure you change the target name, probably the label (you can just specify plain text there if you like) and add the target name to PythonCommands. (Sorry, my first answer was a little rushed and I forgot about some of the details...)

@huguesv huguesv closed this Sep 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment