Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 1.25.11 results in "unterminated quoted identifier at or near ""))"" on migration #7126

Open
bfabio opened this issue Jul 23, 2024 · 0 comments
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@bfabio
Copy link

bfabio commented Jul 23, 2024

GORM Playground Link

go-gorm/playground#753

Description

Upgrading to 1.25.11 caused an error on migration that was working before:

type Author struct {
    ID      string `gorm:"primaryKey"`
    Books []Book   `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;unique"`
}

type Book struct {
    ID       string `gorm:"primaryKey"`
    AuthorID string
}

func TestGORM(t *testing.T) {
    DB.AutoMigrate(&Author{}, &Book{})
}
2024/07/23 13:17:59 /home/fabio/dev/gorm-bug/main.go:31 ERROR: unterminated quoted identifier at or near ""))" (SQLSTATE 42601)
[0.243ms] [rows:0] CREATE TABLE "authors" ("id" text,PRIMARY KEY ("id"),CONSTRAINT "uni_authors_" UNIQUE ("))
@github-actions github-actions bot added the type:with reproduction steps with reproduction steps label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants