smithery/DennisLiuCk

sql-to-osc

SQL to OSC (Online Schema Change) conversion expert for Flyway migration scripts. Use when: (1) Converting SQL migration files to OSC format, (2) User mentions "OSC", "轉換 OSC", "osc.txt", or "Online Schema Change", (3) Working with Flyway ALTER TABLE/CREATE INDEX statements that need OSC conversion.

Installation

$ npx skills add smithery/DennisLiuCk --skill sql-to-osc

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/DennisLiuCk.

npx skills add smithery/DennisLiuCk

Browse all from smithery/DennisLiuCk

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,153 B
  • docs SUMMARY.md 323 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

SQL to OSC Conversion Expert

Convert Flyway SQL migration scripts to OSC format following project conventions.

Quick Reference

OSC Format: {database}<TAB>{table}<TAB>{operations};

SQL OSC
USE db; Remove (db in column 1)
ALTER TABLE tbl Remove (tbl in column 2)
NULL DEFAULT NULL
CREATE INDEX idx ON tbl (col) ADD INDEX idx (col)
varchar VARCHAR
Multiple operations Comma-joined, no space

Conversion Workflow

  1. Read source SQL from src/main/resources/db/migration/
  2. Parse statements: Extract database, table, operations
  3. Transform:

- Remove USE and ALTER TABLE wrappers - Convert NULLDEFAULT NULL - Convert CREATE INDEX...ON tableADD INDEX... - Uppercase data types

  1. Format output: {db}\t{table}\t{op1},{op2},...;
  2. Write to src/main/resources/db/osc/osc-{YYYYMMDD}.txt (e.g., osc-20251212.txt)

Output Requirements

  • Encoding: UTF-8 (no BOM)
  • Line ending: LF (\n)
  • Separator: TAB (\t) between columns
  • Operations: Comma (,) joined, NO space after comma
  • Line ending: Semicolon (;)

Example

Input (V1.0__altermytable.sql):

USE mydb;

ALTER TABLE MY_TABLE
    ADD COLUMN NEW_COL bigint(20) NULL AFTER EXISTING_COL;

CREATE INDEX MY_TABLE_NEW_COL_IDX ON MY_TABLE (NEW_COL);

Output (osc-{YYYYMMDD}.txt):

mydb	MY_TABLE	ADD COLUMN NEW_COL BIGINT(20) DEFAULT NULL AFTER EXISTING_COL,ADD INDEX MY_TABLE_NEW_COL_IDX (NEW_COL);

Conversion Summary Template

✓ 轉換完成

來源: {source_file}
輸出: src/main/resources/db/osc/osc-{YYYYMMDD}.txt

影響資料表: {tables}
操作統計:
  - ADD COLUMN: {count}
  - ADD INDEX: {count}
  - MODIFY COLUMN: {count}