datatables
하는 일
이 스킬은 마이그레이션이 켜져 있을 때 순서가 있는 마이그레이션을 써서 Windmill 데이터 테이블의 스키마를 바꾸는 방법과, 역할 및 권한이 작동하는 방식을 설명합니다. 공유 데이터베이스를 관리하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓Windmill 데이터 테이블에서 열이나 다른 스키마를 추가, 변경, 삭제해야 할 때.
- ✓마이그레이션이 켜져 있고 짝이 되는 down 마이그레이션과 함께 up 마이그레이션을 써야 할 때.
- ✓데이터 테이블에 역할이나 권한을 설정해야 할 때.
스킬 링크
https://github.com/windmill-labs/windmill/blob/main/system_prompts/auto-generated/skills/datatables/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Windmill의 customers 데이터 테이블에 새 열을 추가하고, 이 변경이 마이그레이션으로 기록되도록 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 마이그레이션이 켜져 있을 때 스키마 변경을 버전이 붙은 마이그레이션으로 기록하라고 에이전트에게 지시합니다. 그래서 변경 내용이 워크스페이스와 함께 옮겨 가고 되돌릴 수도 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Data tables: schema changes, migrations and permissions
A data table is a PostgreSQL database managed by Windmill and shared by the whole workspace: scripts, flows and apps reach it by name, main being the default. It is configured in the workspace settings (Data Tables), never created by SQL.
Changing the schema
A data table with migrations enabled keeps its schema as an ordered list of versioned SQL migrations, each an up and an optional down. That list is what git sync and a workspace merge carry, and what rebuilds the schema in another workspace. So first find out whether migrations are enabled on the data table:
- Enabled: make every schema change (CREATE, ALTER, DROP, anything but row data) as a new migration. A change made with plain SQL exists in that one database only, and the history no longer describes it.
- Not enabled: schema changes are plain SQL. Enabling migrations is a workspace admin's decision, made in the Data Tables settings, not a step to take on the way to something else.
Writing a migration:
- Wrap the statements in
BEGIN; ... END;so it applies atomically. Leave the frame out only for a statement that cannot run in a transaction, such asCREATE INDEX CONCURRENTLY: such a migration can fail half applied. - Give it a
downthat undoes theupwhenever the change is reversible. Without one it cannot be rolled back. - Declare the schemas it changes on a leading line of its
up,-- schemas sales, billing, and qualify every name with its schema (sales.orders). A migration waits only on earlier migrations whose schemas overlap its own. One that declares none applies to the whole database and every later migration waits for it, so leave the line out only for a change that really spans the database, such as an extension. - Migrations apply oldest first. One that is applied is not edited: correct it with a new migration.
- Row data is not schema. Insert, update and delete rows with plain SQL, migrations or not.
wmill datatable migrate new <name> scaffolds migrations/datatable/<datatable>/<timestamp>_<name>.up.sql and .down.sql, wmill datatable migrate up pushes the local files and applies what is pending, wmill datatable migrate down rolls back the most recent one and wmill datatable migrate status lists them. All take -d <datatable> and default to main. migrate new --schemas sales,billing writes the -- schemas line, and migrate up --schema sales applies only the pending migrations declaring that schema.
A migration is not a draft
A migration is saved to the workspace and changes the database as soon as it is applied, for everything that reads those tables. To try a schema out without touching tables already in use:
- put the new tables in a schema of their own, created by the same migration (
CREATE SCHEMA IF NOT EXISTS), and point what you are building at it. A raw app names its schema in itsdataconfig, which is why a new app gets a new schema by default; - or work in a workspace fork whose data table was cloned when the fork was created ("Clone schema only" or "Clone schema and data"): migrations applied there change that copy alone, and reach the parent workspace when the fork is merged. A fork that kept the original data table points at the parent's database, so a migration applied in it changes the parent's tables at once.
Altering or dropping a table other scripts or apps use is neither of those: say what depends on it before doing it.
Roles and permissions
Data table roles are a self-hosted Enterprise Edition feature, for data tables on managed Postgres (the instance database or the external managed instance). Without them, and always on a data table backed by a Postgres resource, everyone who can use the data table reaches all of it: there is no per-user, per-schema or per-row access to promise.
A data table under roles is reached as a Postgres role, and Postgres enforces what that role was granted:
- roles are assigned, per data table, to users, groups or folders.
adminis the connection the data table had before roles: it owns the existing objects and ignores grants; - a connection either names a role (
wmill.datatable('main', { role: 'analyst' }),role='analyst'in Python,datatable://main?role=analyst) and holds that role alone, or names none and is resolved from the data table's default role; permission deniedmeans the role in use lacks a grant. Say which role and which object: the grant is a data ta
자주 묻는 질문
그냥 일반 SQL을 실행하면 안 되나요?
마이그레이션이 켜져 있으면 일반 SQL 변경은 한 데이터베이스에만 존재하게 되어, 마이그레이션 기록과 맞지 않게 됩니다.
down 마이그레이션이란 무엇인가요?
up 마이그레이션을 되돌리는 단계이므로, 변경 사항을 원래대로 돌릴 수 있습니다.
마이그레이션을 켤지 누가 정하나요?
워크스페이스 관리자가 Data Tables 설정에서 결정합니다.
상세 정보
작성자의 원본 설명
MUST use when changing a data table's schema, writing or running its migrations, or working with its roles and permissions.
repo: windmill-labs/windmill
인기도
- GitHub 스타
- 18k
- 순위
- #10629
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
commit
18k에이전트가 관례적 형식으로 한 줄짜리 깔끔한 git 커밋 메시지를 쓰도록 돕고, 바뀐 파일만 스테이징합니다.
pr
18k에이전트가 GitHub에 명확한 제목과 설명을 담은 초안 풀 리퀘스트를 열고, 이후 검토 라운드를 따라가도록 돕습니다.
agents
18k에이전트가 자체 모델, 시스템 프롬프트, 도구, 메모리를 가진 재사용 가능한 Windmill AI 에이전트를 만들도록 돕습니다.
cli-commands
18k에이전트가 Windmill 명령줄 도구를 실행해 스크립트, 플로우, 앱, 작업 기록을 관리하도록 돕습니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.