https://github.com/osquery/osquery logo
Title
e

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?
s

sundsta

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

Erich Stoekl

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

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
It uses this library, also made by Kolide https://github.com/kolide/goose
e

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.
s

sundsta

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

Erich Stoekl

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