Migrations in Tina4
Create a table/migration
You want to create a table for the database? Migrations are sequential SQL statements which keep track of your database changes. We recommend using migrations especially when you want to apply changes to a running system or when working in a team.
Windows
c:\projectfolder\migrations\
Linux
/home/username/Documents/projectfolder/migrations
Start up the built in web service
composer start
Click on the following link to create a migration for your project
Default Url http://localhost:7145/migrate
- On this screen you can enter a description for your migration and then type in the SQL you want to run
- SQL statements should be separated by a “;”
- If you write a stored procedure or trigger then only one of those statements is allowed per migration
- You will be shown that the migration was created and a SQL file with the table you just created will be in the migration folder.
Migrations will be run every time you hit up the /migrate route of your project.