Answer the question
In order to leave comments, you need to log in
How to create a migration file in byjg/migration-cli?
I don’t understand how https://github.com/byjg/migration-cli
works
How to create a migration file, their structure looks like this:
<root dir>
|
+-- base.sql
|
+-- /migrations
|
+-- /up
|
+-- 00001.sql
+-- 00002.sql
+-- /down
|
+-- 00000.sql
+-- 00001.sql
Answer the question
In order to leave comments, you need to log in
In short, you need to do it yourself:
https://github.com/byjg/migration/issues/21
Throw files like 00146.sql into the up and down folders with commands like DROP TABLE and CREATE TABLE
Your script is wrong.
> Let's say I made changes to the database, how can I add them to the migration?
You create a migration that has two methods:
1. up - changing the structure of the database or table
2. down - rolling back these changes.
And the command to create an empty migration is in the documentation.migrate create /path/to/sql
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question