Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about Database Migration #182

Closed
strausmann opened this issue Jan 25, 2022 · 4 comments
Closed

Question about Database Migration #182

strausmann opened this issue Jan 25, 2022 · 4 comments

Comments

@strausmann
Copy link
Contributor

Why is a database migration not automatically performed at the end? Is there a reason why this does not happen in the standard?

# BEGIN example code block - migrate database
# . .gp/bash/spinner.sh # COMMENT: Load spinner
# __migrate_msg="Migrating database"
# log_silent "$__migrate_msg" && start_spinner "$__migrate_msg"
# php artisan migrate
# err_code=$?
# if [ $err_code != 0 ]; then
# stop_spinner $err_code
# log -e "ERROR: Failed to migrate database"
# else
# stop_spinner $err_code
# log "SUCCESS: migrated database"
# fi
# END example code block - migrate database

@apolopena
Copy link
Owner

By default when a starter is created there is nothing to migrate right? Also if a user uses a preset in the workspace URL then migrations will happen there and so we dont want to do redundant migrations.

I figure that once a user has something to migrate they will enable it themselves but now that you mention it I do see that that is one extra step they wouldnt have to do. Thoughts?

@strausmann
Copy link
Contributor Author

That was exactly my thought too. Of course, a new project does not need a direct migration. However, there is no indication in the documentation that the migration has already been prepared in the init project, but is still waiting to be activated.

@apolopena
Copy link
Owner

I will add a migration section to the README and talk about typical Laravel migration and seeding setups using .gp/bash/init-project.sh such as what is used in some of the presets (example projects) such as:
https://gitpod.io/#EXAMPLE=1/https://github.com/apolopena/gitpod-laravel-starter
that uses
https://github.com/apolopena/qna-demo-skeleton/blob/main/.gp/bash/init-project.sh

@apolopena
Copy link
Owner

Moved to #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants