Skip to main content

create-migration

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

ソース情報

リポジトリ
OpenCTI-Platform/opencti
ソースの最終更新活動
2026年6月3日 07:37
検出された SKILL.md の言語
英語
スター
10,152
フォーク
1,480

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
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(); }; ```
GitHubで見る