Skip to content

Commit

Permalink
feat[docker]: create session table migration if session driver is set…
Browse files Browse the repository at this point in the history
… to database (#9587)
  • Loading branch information
Sabir Manandhar committed May 20, 2021
1 parent 9eea46a commit c3d75d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/entrypoint_alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ then
cp -a /var/www/html/vendor/laravel/passport/database/migrations/* /var/www/html/database/migrations/
fi

if [ "${SESSION_DRIVER}" == "database" ]
then
cp -a /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub /var/www/html/database/migrations/2021_05_06_0000_create_sessions_table.php
fi

php artisan migrate --force
php artisan config:clear
php artisan config:cache
Expand Down
5 changes: 5 additions & 0 deletions docker/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ then
cp -ax /var/www/html/vendor/laravel/passport/database/migrations/* /var/www/html/database/migrations/
fi

if [ $SESSION_DRIVER = "database" ]
then
cp -ax /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub /var/www/html/database/migrations/2021_05_06_0000_create_sessions_table.php
fi

php artisan migrate --force
php artisan config:clear
php artisan config:cache
Expand Down

0 comments on commit c3d75d3

Please sign in to comment.