Setting creator column values in liquibase changesets

Historically we’ve always used user_id 1 as the value of the creator column when inserting new rows into tables in liquibase files. Shouldn’t this be the daemon user id or the logged in user running the upgrades in case there is one?

Can you give an example of a particular changeset you are looking at?

There is many changesets that set the creator for new rows like this

What is the benefit to be gained of not having creator=1 in these cases?

(Technically it would be a pain to assign this dynamically, instead of hardcoding to 1, and I don’t see any benefit.)

1 Like

Setting the creator to 1 makes the assumption that the admin account added when installing openmrs is never purged, it’s a fair assumption I’m just not sure if it holds all the time.

@wyclif that account can not be deleted unless you delete almost all data from the database. It is referenced in so many tables! :slight_smile:

I guess that’s a fair point, I think it’s a contrived assumption on my point to assume that the account can be deleted. This brings me to the other issue, shouldn’t the creator in this case be the logged in user running the updates and not this admin account? Or may be the daemon user?

You could make a philosophical argument that the logged in user is more correct, but you can also make an argument that setting it to 1 makes more sense.

Regardless, I don’t see why we would spend any effort on this, since the (arguable) real-world benefit is tiny.