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

Error trying to add a record for registered model with gorm.Model #10

Open
ovnicraft opened this issue Jan 9, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ovnicraft
Copy link

Describe the bug

I'm using gorm ORM and i've defined a model including gorm.Model.

type BaseModel struct {
	gorm.Model

	PublicID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();uniqueIndex"`
	Name string `admin:"required:true"`
}

type JobModel struct {
	BaseModel
}

after registering the model and accessing it with admin, I got:

Code: 500. Error: ERROR: column "basemodel" does not exist (SQLSTATE 42703)

To Reproduce
Steps to reproduce the behavior:

  1. register a model which use gorm.Model
  2. Try to add one record from admin
  3. See error

Expected behavior
Admin should allows to add a record.

Screenshots

image

Desktop (please complete the following information):

  • OS: Macos
@ovnicraft ovnicraft added the bug Something isn't working label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant