Skip to content

migrate — @gj-kit/toss-payments-postgresql

A public function from @gj-kit/toss-payments-postgresql. The signature below is taken directly from the 0.5.1 release declaration.

import { migrate } from '@gj-kit/toss-payments-postgresql';
/**
* 마이그레이션 실행 (설계 §4 절차).
*
* 1. BEGIN
* 2. pg_advisory_xact_lock — 동시 부팅 인스턴스 직렬화 (트랜잭션 종료 시 자동 해제)
* 3. CREATE SCHEMA IF NOT EXISTS + 버전 테이블 toss_pg_migrations IF NOT EXISTS
* 4. 미적용 id만 순서대로 실행 + 버전 테이블 INSERT
* 5. COMMIT (실패 시 ROLLBACK 후 'migration-failed'로 감싸 rethrow — cause 보존)
*/
declare function migrate(sql: SqlClient, options?: MigrateOptions): Promise<MigrationResult>;

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/toss-payments-postgresql
  • Version: 0.5.1
  • Public entry: .
  • Source: GitHub