New migration creation - foaudkajj/school-system-backend GitHub Wiki

To create a new migration:

1- Open the CMD in the project root foler, navigate to (cd migration) the migration folder.

2- Run typeorm migration:create ./menu-enabled-column -t 20221109115125 --outputJs

3- After starting the application, the created migration will be executed and if there are no errors a new row will be inserted into migration table. To re-run the migration, you can remove the inserted row from migration table.

-Note1: menu-enabled-column is the name of the migration and you can change it as you want.

-Note2: If you get an error. Ensure that you are using the Command Prompt not the PowerShell.

-Note3: The number after -t (timestamp) parameter is the timestamp of the migration. It should be like (yyyymmddhhmmss) 3- Write the SQL command you want to execute in the up method. Put the undo SQL command in the down method.