Skip to main content

create-migration

Use when: creating a new ElasticSearch database migration file, adding or transforming data at deploy time

Informações da origem

Repositório
OpenCTI-Platform/opencti
Última atividade na origem
3 de junho de 2026 às 07:37
Idioma detectado do SKILL.md
inglês
Estrelas
10.152
Forks
1.480

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
create-migration
description
Use when: creating a new ElasticSearch database migration file, adding or transforming data at deploy time
# Create Database Migration ## Prerequisites - **Description**: Short snake_case description of the change (e.g., `add_description_to_user`). ## Procedure ### Step 1 — Generate Migration File Use the current timestamp (ms) as prefix. File: `opencti-platform/opencti-graphql/src/migrations/<timestamp>-<description>.ts`. ### Step 2 — Implement Migration Pattern Use the standard template with logging and execution context. ```typescript import { logMigration } from '../config/conf'; const message = '[MIGRATION] <Description>'; export const up = async (next: (error?: Error) => void) => { const startTime = Date.now(); logMigration.info(`${message} > started`); // Implementation here // usage: const context = executionContext('migration'); // await someDomainFunction(context, SYSTEM_USER, args); logMigration.info(`${message} > done in ${Date.now() - startTime} ms`); next(); }; export const down = async (next: (error?: Error) => void) => { next(); }; ```
Ver no GitHub