mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
This also gets rid of `Db.collection`, which was another source of circular dependencies.
27 lines
854 B
TypeScript
27 lines
854 B
TypeScript
import { SETTINGS_LICENSE_CERT_KEY } from '@/constants';
|
|
import { BaseCommand } from '../BaseCommand';
|
|
import { SettingsRepository } from '@db/repositories/settings.repository';
|
|
import Container from 'typedi';
|
|
|
|
export class ClearLicenseCommand extends BaseCommand {
|
|
static description = 'Clear license';
|
|
|
|
static examples = ['$ n8n clear:license'];
|
|
|
|
async run() {
|
|
this.logger.info('Clearing license from database.');
|
|
await Container.get(SettingsRepository).delete({
|
|
key: SETTINGS_LICENSE_CERT_KEY,
|
|
});
|
|
this.logger.info('Done. Restart n8n to take effect.');
|
|
}
|
|
|
|
async catch(error: Error) {
|
|
this.logger.error('Error updating database. See log messages for details.');
|
|
this.logger.error('\nGOT ERROR');
|
|
this.logger.info('====================================');
|
|
this.logger.error(error.message);
|
|
this.logger.error(error.stack!);
|
|
}
|
|
}
|