Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework 2.3 how to reset database?

In the Play 2.3.x documentation on Evolutions it says

In development mode however it is often simpler to simply trash your development database and reapply all evolutions from the beginning.

However it doesn't give instructions on how to do this. Is there some kind of activator command I can use to do this? How can I reset and reapply evolutions?

Thanks!

Update: I would prefer not to have to mess with my DB manually, but it seems like that's the only way

like image 906
KJ50 Avatar asked Sep 29 '22 16:09

KJ50


1 Answers

If you don't care about the data you have in your database (make sure you don't), you can just drop the database with a sql command (such as "drop database name"). Once you run "play run" again, it should automatically recreate your tables from the sql scripts if you have followed play framework standards since according to the doc:

"Evolutions are automatically activated if a database is configured in application.conf and evolution scripts are present"

like image 84
Mari Avatar answered Dec 21 '22 13:12

Mari