Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It is necessary to divide the database into parts: structure, service data and operational data. The structure migrates - it includes schema, tables, keys and all that. Service data - for example, table data with some statuses, can migrate, but you need to be careful here (this data is static in normal mode and is necessary for the code to work). And the rest of the data - that is, users there, posts, goods - it's all not migrated . Their integrity lies on other mechanisms - for example, backups.
Why are migrations needed?
and if you constantly need to keep the table with melons up to date? wouldn't it be easier to keep a sql-dump of that table in git/svn ?I won’t say anything about SVN (in my opinion, it died out as a class, even Hg / Mercurial is almost gone), but we do it, we store the base dump in the repository, in some cases we even use Git hooks that check versions A DB and at change - rewrite . dump file and add it to the commit.
Миграции нужны для разработки. Например вася хочет создать новую таблицу. Он создает миграцию, накатывает ее в свой локальный проект и делает коммит в гит, из которого остальные берут его и накатывают миграции в своих копиях проекта. Миграции это контроль версий БД. Он используется в разработке. Если же проект готовый то пользуются другими стеками, типа думпов
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question