Happenn
  • Introduction
  • System Architect
  • For Dev
    • AWS
      • Domain & CNAME
      • Rescale Instance
      • Request AWS Certificate
      • Generate Certificate with Certbot
      • S3
      • SSH & FTP
      • Auto Scaling
      • RDS MySQL
    • Digital Ocean
      • Virtual Host & Certificate
      • SSH & FTP
    • Server
      • Git
      • Setup the Server
    • Code
      • Laravel/Lumen
      • Vue.js
      • Webpack
      • JavaScript Library
        • Lodash
        • axios
        • Moment.js
      • Code Style Guide
      • Useful Tools
    • HAM Admin
      • Install locally
      • Deploy
    • Happenn API
      • Install locally
      • Install DB locally
      • Make DB changes
    • Happenn IO
      • Install locally
    • Happenn Virtual
      • Install locally
      • Folders and file structure
      • Deploy code
        • Happenn AWS
        • Delegia AWS
    • Happenn Event app
      • Deploy
      • Install locally
Powered by GitBook
On this page
  • DB changes (We using migrations)
  • Apply DB changes
  1. For Dev
  2. Happenn API

Make DB changes

PreviousInstall DB locallyNextHappenn IO

Last updated 2 years ago

DB changes (We using migrations)

  • Doc: (For more DB changes)

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

https://laravel.com/docs/7.x/migrations