Cradle / Skip Sql Migrations
Skip Sql Migrations
Bypass SQL migrations during the installation of cradle components.
cradle install --skip-sql cradle install --skip-sql #!/bin/bash
# Skip Sql Migrations
cradle install --skip-sql import subprocess
# Skip Sql Migrations
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"cradle",
"install",
"--skip-sql"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: cradle not found. Please install it first.")
if __name__ == "__main__":
run_command() When To Use
During a high-stakes deployment where immediate application availability is paramount.
Pro Tip
This command can fail silently if there are pending migrations not marked with the correct environment flag, use `--dry-run` to identify potential issues before execution.
Terminal Output
Expected runtime feedback
Cradle CLI - Install Command
------------------------------------------------
Action: Installing without SQL migrations
Status: Skipped SQL migrations successfully
Installation completed in 2s.
Run `cradle status` to verify installation.
------------------------------------------------ Anatomy of Output
Understanding the result
Skipping SQL migrations: ✓ Process Status Indicates successful bypass of SQL migrations.
Installation output: 0 components installed. Components Installed Verifies that components installed or updated without running migrations.
Error Log: No pending migrations detected. Migration Check Confirms absence of pending migrations that could block installation.
Power User Variants
Optimized versions
cradle install --skip-sql --dry-run Preview the installation process without applying changes.
cradle install --skip-sql --force Force install even if inconsistencies exist, risky.
Troubleshooting
Common pitfalls
Error: Migration conflicts detected.
Solution: Resolve migration conflicts before execution.
Error: Insufficient permissions to skip migrations.
Solution: Grant necessary permissions to the user.
Error: Unexpected exit code 1.
Solution: Run with verbosity `-v` for debug details.
Command Breakdown
What each part is doing
-
cradle - Base Command
- The executable that performs this operation. Here it runs Cradle before the shell applies any redirect operators.
-
--skip-sql - Command Option
- Tool-specific option used by this command invocation.
How To Run
Execution path
- Step 1
Run the command: `cradle install --skip-sql`
- Step 2
Verify the result with: `cradle status` to ensure SQL migrations were skipped.
Alternative Approaches
Comparable commands in other tools
Alternative package management tools for the same job.