Skip to content

slicknode migrate

The slicknode migrate command compares the Slicknode project configuration in the working directory with the state of the database and displays all detected changes. It then performs all required migrations to brint the database into a state that matches the current configuration.

If the database schema does not exist, all database tables for storing system information and the data tables will be created.


# Start migration in interactive mode (for development)
slicknode migrate --database-url postgresql://user:secret@localhost:5432/dbname

# Apply migration to a specific schema in the database (for multi tenancy, test / staging etc.)
slicknode migrate --database-schema customer1 --database-url postgresql://user:secret@localhost:5432/dbname

# Perform migrations without confirmation (for CI etc.)
slicknode migrate --force --database-url postgresql://user:secret@localhost:5432/dbname

The configuration options can also be set as environment variables.

Configuration Options

This is a list of all available configuration options and their corresponding environment variable names:

Option Env Variable Default Description
SLICKNODE_DATABASE_URL PostgreSQL DB connection url, for example:

See the PostgreSQL docs for details
SLICKNODE_DATABASE_SCHEMA slicknode The database schema in which the project data is stored
./ Path to the directory that contains the Slicknode project configuration.
false Automatically apply DB migrations on start.
WARNING: Applies migrations immediately when watch mode is on, which can lead to accidental data loss.