with one click
create-migration
// Use when: creating a new ElasticSearch database migration file, adding or transforming data at deploy time
// Use when: creating a new ElasticSearch database migration file, adding or transforming data at deploy time
Use when: scaffolding a creation form drawer with Formik validation and a Relay mutation for a new entity
Use when: scaffolding a new backend entity type, domain module, GraphQL schema, resolvers, or STIX converter in opencti-graphql
Use when: adding a new playbook automation component, implementing a PlaybookComponent interface, or registering a new playbook step
Use when: creating a new Relay-connected React component, defining a GraphQL fragment, or wiring a component to a query
Use when: scaffolding a new GitHub Actions CI/CD workflow, adding automation for tests, builds, releases, or security scans
| name | create-migration |
| description | Use when: creating a new ElasticSearch database migration file, adding or transforming data at deploy time |
add_description_to_user).Use the current timestamp (ms) as prefix.
File: opencti-platform/opencti-graphql/src/migrations/<timestamp>-<description>.js.
Use the standard template with logging and execution context.
import { executionContext, SYSTEM_USER } from '../utils/access';
import { logMigration } from '../config/conf';
const message = '[MIGRATION] <Description>';
export const up = async (next) => {
logMigration.info(`${message} > started`);
const context = executionContext('migration');
// Implementation here
// usage: await someDomainFunction(context, SYSTEM_USER, args);
logMigration.info(`${message} > done`);
next();
};
export const down = async (next) => {
next();
};