Title
#kolide
Erich Stoekl

Erich Stoekl

04/21/2020, 5:17 PM
Is it okay to run
fleet prepare db
every time I run fleet? If the db already exists and is prepared, it shouldn't overwrite any existing data, right?
sundsta

sundsta

04/21/2020, 5:19 PM
Correct. You’ll just have a log of “migrations already completed, nothing to do” with each startup
Erich Stoekl

Erich Stoekl

04/21/2020, 5:34 PM
gotcha. so
prepare db
only does anything if the tables don't already exist?
sundsta

sundsta

04/21/2020, 6:58 PM
It performs the migrations in this directory. They are executed in order. New versions of Fleet may introduce more migrations, they may not. https://github.com/kolide/fleet/tree/master/server/datastore/mysql/migrations
6:59 PM
It uses this library, also made by Kolide https://github.com/kolide/goose
Erich Stoekl

Erich Stoekl

04/21/2020, 7:31 PM
Interesting. I'm deploying fleet in kubernetes -- seems like I should be using
fleet prepare db
in my
command
section so that I ensure my DB stays updated as my version of fleet is updated.
sundsta

sundsta

04/21/2020, 7:31 PM
You should 🙂
Erich Stoekl

Erich Stoekl

04/21/2020, 7:32 PM
Sounds good. Thanks!!