Tripal
|
This directory contains PostgreSQL schema cloning utility. The very original script come from a comment of on PostgreSQL official wiki by Emanuel '3manuek' https://wiki.postgresql.org/wiki/Clone_schema It has been updated to support newer version of PostgreSQL with a couple of bug fixes on the following github project called "pg-clone-schema": https://github.com/denishpatel/pg-clone-schema The pg-clone-schema project comes with an MIT License.
The clone schema script has been modified to fulfill Drupal and Tripal needs. Specifically, it was altered to ensure it could be run multiple times without causing problems. For instance, use "CREATE OR REPLACE" or "IF NOT EXISTS" expressions when possible. Furthermore, an additional script has been added to remove added functions when the module is uninstalled.
All functions added are created within the Drupal schema in order to be available to all Tripal DBX managed schema through a single instance.
Handles following objects:
Arguments:
You can call function like this to copy schema with data:
Alternatively, if you want to copy only schema without data:
If you just want to generate the DDL, call it like this:
In this case, standard output with "INFO" lines are the generated DDL.
Sponsor: http://elephas.io/
Compare cloning with EnterpriseDB's version that only works with their Advanced Server: https://www.enterprisedb.com/edb-docs/d/edb-postgres-advanced-server/user-guides/user-guide/11/EDB_Postgres_Advanced_Server_Guide.1.078.html