Skip to content

Instantly share code, notes, and snippets.

@santiblanko
Created February 19, 2014 05:35
Show Gist options
  • Save santiblanko/9086587 to your computer and use it in GitHub Desktop.
Save santiblanko/9086587 to your computer and use it in GitHub Desktop.
good garbage
#!/bin/bash
echo "Let's get started."
echo -n "What is the name of the database for this app? "
read -e DATABASE
echo Creating MySQL database
mysql -uroot -p -e "CREATE DATABASE $DATABASE"
echo Updating database configuration file
gsed -i "s/'database' => 'database'/'database' => '$DATABASE'/" app/config/database.php
gsed -i "s/'password' => ''/'password' => '1234'/" app/config/database.php
echo -n "Do you need a users table? [yes|no] "
read -e ANSWER
if [ $ANSWER = 'yes' ]
then
echo Creating users table migration
php artisan generate:migration create_users_table --fields="username:string:unique, email:string:unique, password:string"
echo Migrating the database
php artisan migrate
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment