drop-database Command
Note: This command is implemented as part of the
@pinstripe/databasepackage and needs to be included in your project for it to be available.
Interface
The command drops the database with the following signature:
pinstripe drop-database
Parameters
No parameters required.
Examples
# Drop the current database
pinstripe drop-database
Description
The drop-database command is a destructive database operation that completely removes the database and all its data. This command:
- Drops all tables - Removes all database tables and their structure
- Deletes all data - Permanently removes all stored data
- Clears schema - Removes any database schema information
⚠️ Warning: This operation is irreversible. All data will be permanently lost.
Use Cases
Development Environment
- Reset development state - Clear all test data and start fresh
- Schema changes - Remove database before applying new migrations
- Testing cleanup - Reset database state between test runs
Database Maintenance
- Fresh start - Complete database reset for development
- Migration testing - Test migration scripts on clean database
- Troubleshooting - Resolve database corruption issues
Safety Considerations
- Production warning - Never run this command in production environments
- Backup first - Always backup important data before dropping
- Double-check environment - Verify you're in the correct environment
- No confirmation prompt - Command executes immediately without confirmation
Related Commands
initialize-database- Create database schema and initial data after droppingreset-database- Combines drop-database and initialize-database operationsmigrate-database- Apply database migrations to rebuild schemaseed-database- Populate database with seed data