there is a way to copy data from table to a file with pscyopg2 copy_to
or copy_expert
.
Is there any way to copy table structure to a file so that I can create the same table during tests?
It should be done programatically in script, because there are no migrations and from time to time need to regenerate tables structures to file to have valid schema in tests