# migrate-to-1.0

Adopt this skill: https://proskills.md/skills/other/jetbrains-exposed-claude-skills-migrate-to-1-0

Page: https://proskills.md/skills/other/jetbrains-exposed-claude-skills-migrate-to-1-0
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: .claude/skills/migrate-to-1.0/SKILL.md
size: 8056
upstream: https://github.com/jetbrains/exposed/blob/HEAD/.claude/skills/migrate-to-1.0/SKILL.md

````text
---
name: migrate-to-1.0
description: "Migrates a Kotlin project from Exposed 0.61.0 to Exposed 1.0. Scans Kotlin sources and build files, applies the mechanical changes documented in the official 1.0 migration guide (package renames, JDBC module moves, SqlExpressionBuilder lambda → top-level imports, build dependency bumps), and produces a report of items that need manual review. Use when the user wants to upgrade an existing Exposed 0.61.0 project to 1.0; for older 0.x versions the skill emits a compatibility warning and proceeds only with user confirmation."
user_invocable: true
---

# Migrate to Exposed 1.0

Automates the **mechanical** parts of migrating a Kotlin project from Exposed **0.61.0**
to Exposed 1.0. Anything that requires human judgment is detected and reported in a
summary at the end so the user can address it manually using the migration guide.

**Supported starting version: 0.61.0** (the last pre-1.0 release). The official
Migration-Guide-1-0-0.md was written specifically for the 0.61.0 → 1.0.0 jump. If the
detected version is older (e.g. 0.41.x, 0.55.x), the skill warns and asks for explicit
confirmation before proceeding: the rules will still rewrite the package paths it
recognises, but APIs introduced between the detected version and 0.61.0 are out of
scope, and the user should upgrade to 0.61.0 first or expect a noisier manual-review
list.

The canonical source for what to migrate is the official guide:
<https://www.jetbrains.com/help/exposed/migration-guide-1-0-0.html>
(or the local `Migration-Guide-1-0-0.md` if available).

The reference files in `./references/` encode that guide as machine-applicable rules:

- `package-renames.md` — every import-level rename, organised by category (always-apply,
  JDBC-conditional, SqlExpressionBuilder, UUID, datetime, addLogger).
- `module-detection.md` — heuristics for the project fact table
  (`usesJdbc`, `usesR2dbc`, `usesDao`, …).
- `build-files.md` — Gradle KTS / Groovy / version-catalog / Maven edit patterns.
- `manual-review.md` — cases the skill must NOT auto-apply, with detection patterns.

Load each reference file only when the corresponding phase below needs it.

## Operating principles

- Operate on the user's current working tree. Do **not** create branches or commits.
- Never write outside the user's project root.
- Never run `./gradlew` or any other build command on the user's project.
- Idempotent at line level: every edit is a precise `Edit` (`old_string`/`new_string`),
  so re-running the skill after partial completion is safe.
- Cross-check: if a file was changed externally between Phase 1 and Phase 3 (an `Edit`
  fails because `old_string` doesn't match), skip the file with a "skipped — file changed"
  reason and continue.

## Phase 1 — Discover (read-only)

1. Determine whether migration is needed.

   The real signal is whether any source file uses the old `0.x` package paths
   (`org.jetbrains.exposed.sql.*`, `org.jetbrains.exposed.dao.*`,
   `org.jetbrains.exposed.r2dbc.sql.*`, …). Version coordinates in build files are a
   useful hint but don't always reflect reality — projects on a `1.0.0-beta-N` /
   `1.0.0-rc-N` release already use the `v1.*` namespace and don't need this skill,
   even though their coordinate isn't strictly `0.x`.

   a. **Source scan:** look for any `import org.jetbrains.exposed.sql.` or
      `import org.jetbrains.exposed.dao.` (and the R2DBC equivalents) in any `.kt`
      file under `src/`. Record file:line for use in the rename-scan step below.

   b. **Build-file scan:** look for `org.jetbrains.exposed:` coordinates in
      `gradle/libs.versions.toml`, every `build.gradle.kts` / `build.gradle`, and
      `pom.xml`. Record every coordinate version found.

   c. If (a) finds zero old-namespace imports AND (b) finds no pre-1.0 coordinate
      (everything is either `1.0.0` proper or higher, or no Exposed coordinate at all),
      **stop here** and report:
      ```
      No migration needed. Your project does not use the old `org.jetbrains.exposed.sql.*` /
      `.dao.*` namespace and the build files do not pin a pre-1.0 release. Projects on
      `1.0.0-beta-N` / `1.0.0-rc-N` already use the new `v1.*` namespace and don't need
      this skill.
      ```

   d. Otherwise, migration applies. Proceed with the version check below.

   **Version check.** The supported starting version is `0.61.0`. If the detected
   coordinate is something else under `0.x` (e.g. `0.41.x`, `0.55.x`), print the
   warning below and let the user decide whether to continue:
   ```
   ⚠️  Detected Exposed <X.Y.Z>, but this skill targets the 0.61.0 → 1.0.0 migration.
       Older 0.x versions may use APIs that were renamed or removed before 0.61.0;
       those changes are NOT covered by this skill. Recommended path:
         1. Upgrade your project to Exposed 0.61.0 first.
         2. Re-run this skill.
       Proceed anyway? The skill will rewrite recognised package paths, but expect a
       noisier "manual review" list and possibly missed changes.
   ```
   If the user declines, exit cleanly. If they confirm, continue but include the
   version-mismatch warning in the Phase 4 summary.

   Beta/RC of 1.0 with `sql.*` imports somehow still present (e.g. a half-finished
   manual migration) is also valid input: the source scan in (a) catches it and the
   skill proceeds without emitting the `0.61.0` warning, since the user is already
   targeting 1.0.0.

2. Build the project fact table per `references/module-detection.md`.

3. Enumerate every Kotlin file under `src/` (recursively). For each file, run two scans:
    - **Rename scan** — grep for any pattern in `references/package-renames.md` (sections
      1–6). Record file:line + which pattern hit.
    - **Manual-review scan** — grep for any pattern in `references/manual-review.md`.
      Record file:line + which case.

4. Print a Phase 1 summary to the user:
   ```
   Discovered:
     • Exposed version <X.Y.Z> in <build files>
     • Project flavor: usesJdbc=<bool>, usesR2dbc=<bool>, usesDao=<bool>, ...
     • <N> Kotlin files contain 0.x imports (<M> imports total)
     • <K> manual-review cases across <L> files
     • Build files to update: <list>
   ```

## Phase 2 — Plan (interactive checkpoint)

1. Print a one-paragraph plan to the user:
   ```
   Planned changes:
     1. Apply <category-1> rewrites to <N1> files.
     2. Apply <category-2> rewrites to <N2> files.
     3. Update <build-file> dependencies.
     4. Report <K> manual-review items at the end (no source edits).
   ```

2. **Stop and ask the user to confirm before any edits.** Wait for their response.

3. If the user says "skip <category>", remove that category from the plan and proceed.
   If the user declines, exit cleanly with no changes.

## Phase 3 — Apply (write phase)

For each Kotlin source file with rename hits, apply edits in this order:

a. **Section 1 (always-apply renames)** from `references/package-renames.md`. Each row
becomes one or more `Edit` calls (`old_string` = the 0.61.0 FQN; `new_string` = the
1.0.0 FQN).

b. **Section 2 (JDBC-conditional moves)** — only if the project's `usesJdbc` is true AND
the file does not contain any R2DBC import. Apply each row as in (a).

c. **Section 3 (`SqlExpressionBuilder` lambda imports)** — for every line of the form
`import org.jetbrains.exposed.sql.SqlExpressionBuilder.<NAME>`, rewrite to
`import org.jetbrains.exposed.v1.core.<NAME>`. The list of `<NAME>` values is in
`package-renames.md` Section 3, but the rule is independent of which method —
if the prefix matches, rewrite.

d. **Section 4 (UUID)**, **Section 5 (Datetime)**, **Section 6 (StdOutSqlLogger / addLogger)**
from `package-renames.md` — apply each row as in (a). For
`import org.jetbrains.exposed.sql.addLogger`, **delete the import line** entirely
instead of rewriting it (the function became a method).

If any `Edit` fails (`old_string` not unique or not present), skip just that edit, record
the reason, and continue with the rest o
````

## File: README.md
upstream: https://github.com/jetbrains/exposed/blob/HEAD/README.md

```text
<div align="center">

  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="./documentation-website/Writerside/images/exposed-text-light.png">
    <img alt="Exposed logo" src="./documentation-website/Writerside/images/exposed-text-dark.png" width="215">
  </picture>

</div>
<br>

<div align="center">

[![Official JetBrains project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![Kotlin](https://img.shields.io/badge/dynamic/toml?url=https://raw.githubusercontent.com/JetBrains/Exposed/refs/heads/main/gradle/libs.versions.toml&query=%24.versions.kotlin&logo=kotlin&label=kotlin&color=blue)](http://kotlinlang.org)
[![Slack Channel](https://img.shields.io/badge/chat-exposed-yellow.svg?logo=slack)](https://kotlinlang.slack.com/messages/exposed/)
[![TC Build status](https://exposed.teamcity.com/app/rest/builds/buildType:id:Exposed_Build/statusIcon.svg)](https://exposed.teamcity.com/viewType.html?buildTypeId=Exposed_Build&guest=1)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.exposed/exposed-core?label=maven+central)](https://central.sonatype.com/search?namespace=org.jetbrains.exposed)
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)

</div>

## Welcome to **Exposed**, an ORM framework for [Kotlin](https://github.com/JetBrains/kotlin).

[Exposed](https://www.jetbrains.com/exposed/) is a lightweight SQL library on top of a database connectivity driver for the Kotlin programming language,
with support for both JDBC and R2DBC (since version 1.0.0-*) drivers. 
It offers two approaches for database access: a typesafe SQL-wrapping Domain-Specific Language (DSL) and a lightweight Data Access Object (DAO) API.

Our official mascot is the cuttlefish, which is well-known for its outstanding mimicry ability that enables it to blend seamlessly into any environment.
Similar to our mascot, Exposed can be used to mimic a variety of database engines, which helps you to build applications without dependencies on any specific database engine and to switch between them with very little or no changes.

## Supported Databases

- H2 (versions 2.x)
- [![MariaDB](https://img.shields.io/badge/MariaDB-003545?style=for-the-badge&logo=mariadb&logoColor=white)](https://github.com/mariadb-corporation/mariadb-connector-j)
- [![MySQL](https://img.shields.io/badge/mysql-4479A1.svg?style=for-the-badge&logo=mysql&logoColor=white)](https://github.com/mysql/mysql-connector-j)
- [![Oracle](https://img.shields.io/badge/Oracle-F80000?style=for-the-badge&logo=oracle&logoColor=white)](https://www.oracle.com/ca-en/database/technologies/appdev/jdbc-downloads.html)
- [![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)](https://jdbc.postgresql.org/)
  (Also, PostgreSQL using the [pgjdbc-ng](https://impossibl.github.io/pgjdbc-ng/) JDBC driver)
- [![Amazon Redshift](https://img.shields.io/badge/Amazon%20Redshift-3b46ca?style=for-the-badge&logo=amazonredshift&logoColor=white)](https://docs.aws.amazon.com/redshift/latest/mgmt/jdbc20-install.html) (JDBC only)
- [![MicrosoftSQLServer](https://img.shields.io/badge/Microsoft%20SQL%20Server-CC2927?style=for-the-badge&logo=microsoft%20sql%20server&logoColor=white)](https://github.com/microsoft/mssql-jdbc)
- [![SQLite](https://img.shields.io/badge/sqlite-%2307405e.svg?style=for-the-badge&logo=sqlite&logoColor=white)](https://github.com/xerial/sqlite-jdbc)

## Dependencies

Releases of Exposed are available in the [Maven Central repository](https://search.maven.org/search?q=org.jetbrains.exposed).
For details on how to configure this repository and how to add Exposed dependencies to an existing Gradle/Maven project,
see the full [guide on modules](https://www.jetbrains.com/help/exposed/exposed-modules.html).

### Exposed modules

`Exposed` consists of the following core modules:

| Module              | Function                                                                                                                                                                         |
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `exposed-core`      | Provides the foundational components and abstractions needed to work with databases in a type-safe manner and includes the Domain-Specific Language (DSL) API                    |
| `exposed-dao`       | (Optional) Allows you to work with the Data Access Object (DAO) API. <br> It is only compatible with `exposed-jdbc`; with `exposed-r2dbc`, use `exposed-dao-r2dbc` instead.</br> |
| `exposed-dao-r2dbc` | (Optional) Allows you to work with the Data Access Object (DAO) API over `exposed-r2dbc`. <br> It is an experimental preview, so its API may change between releases.</br>       |
| `exposed-jdbc`      | Provides support for Java Database Connectivity (JDBC) with a transport-level implementation based on the Java JDBC API                                                          |
| `exposed-r2dbc`     | Provides support for Reactive Relational Database Connectivity (R2DBC)                                                                                                           |

As well as the following extension modules:

| Module                         | Function                                                                                                                                                                        |
|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `exposed-crypt`                | Provides additional column types to store encrypted data in the database and encode/decode it on the client-side, as well as one-way hashed data such as passwords              |
| `exposed-java-time`            | Date-time extensions based on the [Java 8 Time API](https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html)                                                   |
| `exposed-jodatime`             | Date-time extensions based on the [Joda-Time](https://www.joda.org/joda-time/) library                                                                                          |
| `exposed-json`                 | JSON and JSONB data type extensions                                                                                                                                             |
| `exposed-kotlin-datetime`      | Date-time extensions based on the [`kotlinx-datetime`](https://kotlinlang.org/api/kotlinx-datetime/) library                                                                    |
| `exposed-migration-core`       | Provides core common functionality for database schema migrations                                                                                                               |
| `exposed-migration-jdbc`       | Provides utilities to support database schema migrations, with a reliance on a JDBC driver                                                                                      |
| `exposed-migration-r2dbc`      | Provides utilities to support database schema migrations, with a reliance on a R2DBC driver                                                                                     |
| `exposed-money`                | Extensions to support [`MonetaryAmount`](https://javamoney.github.io/apidocs/java.money/javax/money/MonetaryAmount.html) from the [JavaMoney API](https://javamoney.github.io/) |
| `exposed-spring-boot-starter`  | A starter for [Spring Boot 3](https://spring.io/projects/spring-boot) to utilize Exposed as the ORM                                                               
```
