Other than that, the patch LGTM. If the other reviewers have no objections, I'll mark it as ready for committer.
Before committing, thinking of all these features, triggers, constraints, tables, etc, to be all of them really useful, wouldn't it be better to have an option to drop them first or create if not exists when available ?