Make DB changes

DB changes (We using migrations)

Create Table:

  • php artisan make:migration create_users_table --create=users

Update Table:

  • php artisan make:migration add_votes_to_users_table --table=users This will generate a file in database\migrations folder

Apply DB changes

Move the file to database\migrations\2022-general For each year we create a new folder. Command:

  • php artisan migrate --path=database/migrations/2022-general This will add DB changes to the same source as your ENV file is set to at the moment. (You could run this command on your local machine to do changes directly on AWS RDS Production server, be careful). If you run this command on production server make sure you go to correct folder: cd to go to /var/www/html

Last updated