ZodulaZodula
Cli

Push

Push

push

Push migrations to the project and apply predefined data.

Usage

nailgun push [options]

Options

  • -d, --dryRun - Dry run and show interactive prompts

Description

The push command applies migrations to your project and handles predefined data. It's similar to migrate but includes additional steps for pushing changes and applying fixtures.

What It Does

  1. Starts up the Zodula server
  2. Pushes migrations to the project
  3. Applies predefined data
  4. Applies fixtures (sample data)
  5. Handles database schema updates

Dry Run Mode

Use the --dryRun option to preview what changes will be made without actually applying them:

nailgun push --dryRun

This will:

  • Show you what migrations will be applied
  • Display interactive prompts for confirmation
  • Not make any actual changes to the database

Example

$ nailgun push

 Starting up server...
 Pushing migrations...
 Applying predefine...
 Applying fixtures...
 Push completed successfully

When to Use

Use push when:

  • You want to apply migrations with additional data setup
  • You need to apply predefined system data
  • You want to ensure fixtures are applied
  • You're setting up a fresh environment
  • You need to sync database changes

Difference from Migrate

While migrate focuses on schema changes, push includes:

  • Predefined Data: Applies system-level predefined data
  • Fixtures: Ensures sample data is applied
  • Additional Setup: Handles extra configuration steps

Important Notes

  • The command will exit after completion
  • Changes are applied to the main database
  • Predefined data is applied within a transaction
  • Fixtures are applied after migrations

Tips

  • Use --dryRun to preview changes first
  • Run push after major schema changes
  • Ensure your database is accessible
  • Consider backing up before running push
  • Test in development before production

Troubleshooting

If push fails:

  1. Check the error messages in the terminal
  2. Ensure your database is accessible
  3. Verify migration files are valid
  4. Check for any data conflicts
  5. Consider restoring from backup if needed