JeffreyWay / Vagrant-Setup

My Vagrant install script
251 stars 104 forks source link

Database #2

Closed Jamesking56 closed 9 years ago

Jamesking56 commented 11 years ago

Hello,

Thanks for the Vagrant setup, its working very well on my Mac!

Only trouble is, what can i put in the install.sh file to tell the Vagrant setup to Create the relevant database tables, migrate them and seed them?

Would be great to automate database setup too :)

BeingTomGreen commented 11 years ago

You should just be able to do something like:

if [ -f /database/base.sql ]
then
    mysql -u root -proot < /database/base.sql
    echo -e "\nInitial MySQL import..."
else
    echo -e "\nNo initial MySQL dump found found... skipping..."
fi

I have used something similar to setup a base table, then you can just run artisan migrate and artisan db:seed.

brunowego commented 10 years ago

:+1:

Jamesking56 commented 9 years ago

Since Homestead now creates tables for you, this isn't relevant anymore.