ワンクリックで
add-migration
// Creates a Flyway Java-based migration for schema changes. Handles table creation, column additions, tenant isolation, and ES reindex. Use when asked to modify the database schema.
// Creates a Flyway Java-based migration for schema changes. Handles table creation, column additions, tenant isolation, and ES reindex. Use when asked to modify the database schema.
| name | add-migration |
| description | Creates a Flyway Java-based migration for schema changes. Handles table creation, column additions, tenant isolation, and ES reindex. Use when asked to modify the database schema. |
ls openaev-api/src/main/java/io/openaev/migration/ | sort | tail -5
Pattern: V4_{XX}__Description.java — increment XX.
Location: openaev-api/src/main/java/io/openaev/migration/
package io.openaev.migration;
import java.sql.Statement;
import org.flywaydb.core.api.migration.BaseJavaMigration;
import org.flywaydb.core.api.migration.Context;
import org.springframework.stereotype.Component;
@Component
public class V4_XX__Description extends BaseJavaMigration {
@Override
public void migrate(Context context) throws Exception {
try (Statement statement = context.getConnection().createStatement()) {
// SQL here
}
}
}
For tenant-scoped tables:
CREATE TABLE my_entities (
my_entity_id VARCHAR(255) NOT NULL,
my_entity_name VARCHAR(255) NOT NULL,
tenant_id VARCHAR(255) NOT NULL,
-- ... other columns ...
CONSTRAINT pk_my_entities PRIMARY KEY (my_entity_id),
CONSTRAINT fk_my_entities_tenant FOREIGN KEY (tenant_id)
REFERENCES tenants(tenant_id) ON DELETE CASCADE
);
CREATE INDEX idx_my_entities_tenant ON my_entities(tenant_id);
Default tenant: 2cffad3a-0001-4078-b0e2-ef74274022c3
If modifying an entity indexed in Elasticsearch, add a reindex trigger:
DELETE FROM indexing_status;
mvn clean install -DskipTests -Pdev # Migration runs on startup
mvn test # Ensure tests pass with new schema
Creates tests for an existing feature following OpenAEV patterns: fixture class, composer, integration test with @Nested groups, and optionally unit tests. Use when asked to add tests or improve test coverage.
Scaffolds a complete feature end-to-end: JPA entity, repository, service, DTOs, mapper, controller, migration, tests (fixture + composer + integration test), and frontend actions/page. Use when asked to create a new feature or module.
Step-by-step general code review procedure for OpenAEV pull requests. Covers architecture, conventions, code quality, and delegation to specialized agents.
Frontend review checklist for OpenAEV React/TypeScript code: component patterns, forms, MUI usage, permissions, i18n, state management, dead code. Use when reviewing PRs or auditing frontend features.
Step-by-step tenant isolation audit for OpenAEV pull requests. Use when reviewing PRs that touch entities, repositories, native queries, or migrations.
Performance review checklist for OpenAEV code: N+1 queries, fetch strategy, pagination, indexing, memory usage. Use when reviewing PRs or auditing performance of a feature.