pg icon indicating copy to clipboard operation
pg copied to clipboard

Checking for table (of model) existence?

Open TudorHulban opened this issue 4 years ago • 1 comments

Hi, Kindly please advise how would one check if a table (created based on model) would exist. I would like to perform a schema integrity check every time the app starts for reporting the user any data corruption. It would be great to check for the table existing but even better that the table has the same structure when checked as the model (ex. signalize there is a field missing). (I see https://github.com/go-pg/pg/issues/799 is closed.)

Thank you!

TudorHulban avatar Apr 27 '20 12:04 TudorHulban

For structure checking I see #1570 could be helpful.

TudorHulban avatar Apr 30 '20 17:04 TudorHulban