drizzle-team / drizzle-team/drizzle-orm

[BUG]:Sqlite Migrations Generated With Wrong Dialect

Open
#4,755 3 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [ ] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.44.2

### What version of `drizzle-kit` are you using?

0.31.2

### Other packages

expo-sqlite@14.0.6, expo-drizzle-studio-plugin@0.1.2

### Describe the Bug

Whenusing Drizzle ORM with Expo SQLite in a React Native (Expo) app. I am encountering the following error when Drizzle attempts to run migrations:

```
[DrizzleError: Failed to run the query '
CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (
id SERIAL PRIMARY KEY,
hash text NOT NULL,
created_at numeric
)
']
```

This error occurs after running the app several times. I confirmed that drizzle-orm/sqlite-core/dialect.js in my node_modules still contains SQL with SERIAL, even though the Drizzle team has previously stated this was fixed by https://github.com/drizzle-team/drizzle-orm/pull/2970#issue-2526653390 as stated in this issue https://github.com/drizzle-team/drizzle-orm/issues/2384#issuecomment-2351653573. Also found out the same error in the latest version of drizzle-orm.

Here is my drizzle.config.ts

```
import { defineConfig, Config } from "drizzle-kit";

export default defineConfig({
dialect: "sqlite",
driver: "expo",
schema: "./db/schema.ts",
out: "./drizzle",
} satisfies Config);

```

### Expected behavior

All migrations should be applied accordingly.

### Environment & setup

Android 34
Expo SDK 51.0.39
expo-sqlite 14.0.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.