package
4.1.0
Repository: https://github.com/mtfelisb/migrate.git
Documentation: pkg.go.dev

# README

postgres

postgres://user:password@host:port/dbname?query (postgresql:// works, too)

URL QueryWithInstance ConfigDescription
x-migrations-tableMigrationsTableName of the migrations table
x-migrations-table-quotedMigrationsTableQuotedBy default, migrate quotes the migration table for SQL injection safety reasons. This option disable quoting and naively checks that you have quoted the migration table name. e.g. "my_schema"."schema_migrations"
x-statement-timeoutStatementTimeoutAbort any statement that takes more than the specified number of milliseconds
x-multi-statementMultiStatementEnabledEnable multi-statement execution (default: false)
x-multi-statement-max-sizeMultiStatementMaxSizeMaximum size of single statement in bytes (default: 10MB)
dbnameDatabaseNameThe name of the database to connect to
search_pathThis variable specifies the order in which schemas are searched when an object is referenced by a simple name with no schema specified.
userThe user to sign in as
passwordThe user's password
hostThe host to connect to. Values that start with / are for unix domain sockets. (default is localhost)
portThe port to bind to. (default is 5432)
fallback_application_nameAn application_name to fall back to if one isn't provided.
connect_timeoutMaximum wait for connection, in seconds. Zero or not specified means wait indefinitely.
sslcertCert file location. The file must contain PEM encoded data.
sslkeyKey file location. The file must contain PEM encoded data.
sslrootcertThe location of the root certificate file. The file must contain PEM encoded data.
sslmodeWhether or not to use SSL (disable|require|verify-ca|verify-full)

Upgrading from v1

  1. Write down the current migration version from schema_migrations
  2. DROP TABLE schema_migrations
  3. Wrap your existing migrations in transactions (BEGIN/COMMIT) if you use multiple statements within one migration.
  4. Download and install the latest migrate version.
  5. Force the current migration version with migrate force <current_version>.

Multi-statement mode

In PostgreSQL running multiple SQL statements in one Exec executes them inside a transaction. Sometimes this behavior is not desirable because some statements can be only run outside of transaction (e.g. CREATE INDEX CONCURRENTLY). If you want to use CREATE INDEX CONCURRENTLY without activating multi-statement mode you have to put such statements in a separate migration files.

# Functions

No description provided by the author
No description provided by the author

# Variables

No description provided by the author
10 MB.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author