ワンクリックで
database-schema
Database schema design guide — table naming, column conventions, index strategy, and JPA entity mapping patterns.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Database schema design guide — table naming, column conventions, index strategy, and JPA entity mapping patterns.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Usage guide for the-sdk common library — HTTP request/response logging with UUID Log-ID, CommonApiResponse wrapping, ExpectedException handling, and Swagger auto-configuration.
Dockerfile and docker-compose authoring guide — multi-stage builds, layer caching, security best practices, and compose service wiring.
Database schema design guide — table naming, column conventions, index strategy, and JPA entity mapping patterns.
Conduct an in-depth structured interview with the user to uncover non-obvious requirements, tradeoffs, and constraints, then produce a detailed implementation spec file.
Conduct an in-depth structured interview with the user to uncover non-obvious requirements, tradeoffs, and constraints, then produce a detailed implementation spec file.
Create Git commits by splitting changes into logical units following project conventions. Handles Git Flow automatically — detects develop branch and checks out a feature branch before committing.
| name | database-schema |
| description | Database schema design guide — table naming, column conventions, index strategy, and JPA entity mapping patterns. |
| allowed-tools | AskUserQuestion |
Before providing schema guidance, ask the user about their migration tooling:
AskUserQuestion: "DB 마이그레이션 도구로 무엇을 사용하고 있나요?"
options:
- Flyway
- Liquibase
- 사용하지 않음 (JPA DDL auto)
Then provide the relevant migration section below along with the core conventions.
snake_case, plural (users, api_keys)snake_case (created_at, is_active){referenced_table_singular}_id (user_id, club_id)idx_{table}_{columns} (idx_users_email)uq_{table}_{columns} (uq_users_email)Include in every entity table:
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
is_active, status enum): indexing rarely helps-- Composite index example
CREATE INDEX idx_posts_user_created ON posts (user_id, created_at DESC);
(Include this section if the user selected Flyway)
File naming: V{version}__{description}.sql
db/migration/
V1__create_users.sql
V2__add_api_keys.sql
V3__add_index_users_email.sql
-- V2__add_api_keys.sql
CREATE TABLE api_keys (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
key_value VARCHAR(64) NOT NULL,
created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
CONSTRAINT fk_api_keys_user FOREIGN KEY (user_id) REFERENCES users (id),
CONSTRAINT uq_api_keys_value UNIQUE (key_value)
);
(Include this section if the user selected Liquibase)
File naming: db/changelog/{version}-{description}.yaml
# db/changelog/002-add-api-keys.yaml
databaseChangeLog:
- changeSet:
id: 002-add-api-keys
author: dev
changes:
- createTable:
tableName: api_keys
columns:
- column:
name: id
type: BIGINT
autoIncrement: true
constraints:
primaryKey: true
- column:
name: user_id
type: BIGINT
constraints:
nullable: false
- column:
name: key_value
type: VARCHAR(64)
constraints:
nullable: false
unique: true
@Entity
@Table(name = "api_keys")
class ApiKey(
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
val user: User,
@Column(name = "key_value", nullable = false, unique = true, length = 64)
val keyValue: String,
) : BaseEntity()