JasperFx / marten

.NET Transactional Document DB and Event Store on PostgreSQL
https://martendb.io
MIT License
2.74k stars 428 forks source link

Is there a way to create tables outside of main program code (aka schema creation / update)? #3246

Closed HistoricallyCorrect closed 1 month ago

HistoricallyCorrect commented 1 month ago

First Marten is awesome.

I understand there are different levels of auto schema creation during application startup. https://martendb.io/schema/#marten-and-the-postgresql-schema

I'm potentially going to face a permission issue that, the application db credential may not have enough privilege to create/update tables during application startup. Generally this step (schema update) is done as part of the CICD deployment process, where a different credential with higher privilege is temporarily granted to perform the db operations.

I'm trying to find out if this way is appropriate for Marten, how I can do it or is there any other suggested and better approach in dealing with this kind of issues.

Thanks.