Tags: go-pg/migrations
Tags
Add a way to disable automatic schema creation (#106) * Don't try to create a schema that exists This commit removes the behavior of executing `CREATE SCHEMA IF NOT EXISTS` when the schema already exists. This would fail when the schema is created beforehand (by a superuser) and the current user doesn't have the `CREATE` privilege on the current database, hence is not allowed to create the schema. We do keep the `IF NOT EXISTS` part of the query to avoid a (probably very rare) race condition in which the schema wouldn't exist during the initial check but would when attempting to create it. * Remove special handling of the "public" schema We now do attempt to create it if not exists. Note that the `CREATE SCHEMA IF NOT EXISTS <schema>` query is now always run at init, even if the schema is "public".
PreviousNext