Is it okay to run `fleet prepare db` every time I ...
# kolide
e
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
Correct. You’ll just have a log of “migrations already completed, nothing to do” with each startup
e
gotcha. so
prepare db
only does anything if the tables don't already exist?
s
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
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
You should 🙂
e
Sounds good. Thanks!!