mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-04 07:46:21 +02:00
67 lines
1.6 KiB
TypeScript
67 lines
1.6 KiB
TypeScript
import { BaseCommand } from '@adonisjs/core/build/standalone';
|
|
export default class DbWipe extends BaseCommand {
|
|
static commandName: string;
|
|
static description: string;
|
|
static settings: {
|
|
loadApp: boolean;
|
|
};
|
|
/**
|
|
* Choose a custom pre-defined connection. Otherwise, we use the
|
|
* default connection
|
|
*/
|
|
connection: string;
|
|
/**
|
|
* Drop all views in database
|
|
*/
|
|
dropViews: boolean;
|
|
/**
|
|
* Drop all types in database
|
|
*/
|
|
dropTypes: boolean;
|
|
/**
|
|
* Force command execution in production
|
|
*/
|
|
force: boolean;
|
|
/**
|
|
* Not a valid connection
|
|
*/
|
|
private printNotAValidConnection;
|
|
/**
|
|
* Prompts to take consent when wiping the database in production
|
|
*/
|
|
private takeProductionConstent;
|
|
/**
|
|
* Drop all views (if asked for and supported)
|
|
*/
|
|
private performDropViews;
|
|
/**
|
|
* Drop all tables
|
|
*/
|
|
private performDropTables;
|
|
/**
|
|
* Drop all types (if asked for and supported)
|
|
*/
|
|
private performDropTypes;
|
|
/**
|
|
* Run as a subcommand. Never close database connections or exit
|
|
* process inside this method
|
|
*/
|
|
private runAsSubCommand;
|
|
/**
|
|
* Branching out, so that if required we can implement
|
|
* "runAsMain" separately from "runAsSubCommand".
|
|
*
|
|
* For now, they both are the same
|
|
*/
|
|
private runAsMain;
|
|
/**
|
|
* Handle command
|
|
*/
|
|
run(): Promise<void>;
|
|
/**
|
|
* Lifecycle method invoked by ace after the "run"
|
|
* method.
|
|
*/
|
|
completed(): Promise<void>;
|
|
}
|