소스 정보
- 저장소
- c9s/bbgo
- 최근 소스 활동
- 2026년 5월 30일 02:00
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1,658
- 포크
- 380
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/c9s/bbgo --skill add-migration명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | add-migration |
| description | Add new database migration for the bbgo trading bot framework |
| user-invocable | true |
Create a new database migration for the bbgo project covering both MySQL and SQLite3.
You will be given a [migration_name] from the user. If not provided, ask the user for it.
Before writing the migration SQL, ask the user what the migration should do (e.g., "Add a new table for storing user preferences" or "Alter the orders table to add a new column for order source").
Run both commands from the repository root (/Users/dboy/Work/bbgo):
rockhopper --config ./rockhopper_sqlite.yaml create --type sql [migration_name]
rockhopper --config ./rockhopper_mysql.yaml create --type sql [migration_name]
This creates timestamped .sql files under migrations/mysql/ and migrations/sqlite3/.
Each migration file uses this format:
-- +up
-- +begin
<UP migration SQL here>
-- +end
-- +down
-- +begin
<DOWN migration SQL here>
-- +end
Write the MySQL migration first, then translate it to SQLite3-compatible SQL.
Key differences when translating MySQL → SQLite3:
gid column is presented: BIGINT UNSIGNED NOT NULL AUTO_INCREMENT → INTEGER PRIMARY KEY AUTOINCREMENTVARCHAR(N) → TEXTDECIMAL(M, N) → REALKEY or named index definitions inline in CREATE TABLE; use separate CREATE INDEX statements if neededUNIQUE KEY inline; use CREATE UNIQUE INDEX instead or a UNIQUE constraintDATETIME(3) works in both but SQLite ignores the precisionALTER TABLE ... ADD KEY/INDEX; use CREATE INDEX separatelyALTER TABLE support (no DROP COLUMN before 3.35, no MODIFY COLUMN)Ask the user what the migration should do if not obvious from the name, then write the SQL for both files.
rockhopper --config ./rockhopper_sqlite.yaml compile --output ./pkg/migrations/sqlite3
rockhopper --config ./rockhopper_mysql.yaml compile --output ./pkg/migrations/mysql
This generates Go files in pkg/migrations/mysql/ and pkg/migrations/sqlite3/.
Run a build to ensure the generated Go code compiles:
go build ./pkg/migrations/...
If the user has a local database configured, test the migration:
rockhopper --config ./rockhopper_mysql.yaml up
rockhopper --config ./rockhopper_sqlite.yaml up
Only do this if the user explicitly requests it or has a local database available, since it requires a running database connection.
rockhopper create-- +up and -- +down sectionsDROP TABLE IF EXISTS for a CREATE TABLE)ALTER TABLE migrations, the down should reverse the alteration.sql files in migrations/ and the generated .go files in pkg/migrations/