Extensions (Postgres)
Postgres version sources can manage extensions with three version-level keys: createextension, dropextension and alterextension. They sit next to createtable / altertable inside a version, and are applied before that version’s tables.
These keys are Postgres-only.
Each key takes an array whose entries are either a plain extension name or an object with a name field plus extra options.
Create extension
Compiles to CREATE EXTENSION IF NOT EXISTS <name>;.
{
"engine": "postgres",
"name": "template-name",
"version": [
{
"_id": "1.0.0",
"createextension": ["btree_gist", "pgcrypto"]
}
]
}Drop extension
Compiles to DROP EXTENSION IF EXISTS <name>;. Set cascade to true to append CASCADE.
{
"dropextension": [
"pgcrypto",
{ "name": "btree_gist", "cascade": true }
]
}Alter extension
Compiles to ALTER EXTENSION <name> UPDATE;, or ALTER EXTENSION <name> UPDATE TO '<version>'; when a version is given.
{
"alterextension": [
"pgcrypto",
{ "name": "btree_gist", "version": "1.7" }
]
}Last updated on