Skip to content

Migrations for SQLite is sometimes generating invalid syntax #5021

Closed

Description

@marcelomendoncasoares

Describe the bug

After #4988, a regression was introduced where the generated INSERT statement for the serverpod_sqlite_schema table would be incomplete, leading to an INSERT error when trying to apply migrations.

To reproduce

Create a project with one model having a table that sorts last (like "z_table_name"), one column with a non-basic type (like UUID) and the last column with a basic type. Like:

class: MyTable
table: z_table_name
fields:
  id: UuidValue?, defaultPersist=random
  name: String

The generated migration SQL will be broken.

Expected behavior

Migrations should work.

Library version

3.5.0-beta.4

Platform information

N/A

Additional context

No response

How experienced are you with this library?

Expert - Experienced and comfortable with using this library in complex projects

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    bug
    area: database
    area: migrations
    on Apr 29, 2026
  2. moved this from Inbox 📫 to In Progress 🔥 in Serverpod Frameworkson Apr 29, 2026
  3. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: databasearea: migrationsbug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions