B
B
beginer1232016-08-21 11:16:18
Flask
beginer123, 2016-08-21 11:16:18

Python how migrations work?

Hello, a small question on migrations, on the principle of their work
Did I understand everything correctly and did it? I work on Flask
I have a database with tables,
I decided to create tables further through migrations
I created a migratyon.py file at the root I
added the code from https://flask-migrate.readthedocs.io/en/latest/
first I did init - it just creates add a folder with migrations
then I do migrate - it creates a version of the migration (as with git commit)
then I do an update - it applies changes to the Base (like git push)
BUT, why when I do all this I delete all other tables created not through migrations?
How to make it so that it does not delete, but only supplements the database with new tables?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DuD, 2016-08-23
@DuD

Create the first migration and stick the database structure into it.
In order for the migrations to work, there must be a complete history of building the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question