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

Json column type instead of jsonb with .ToJson() #3319

Closed
Mandrakia opened this issue Oct 17, 2024 · 2 comments
Closed

Json column type instead of jsonb with .ToJson() #3319

Mandrakia opened this issue Oct 17, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@Mandrakia
Copy link

Mandrakia commented Oct 17, 2024

I haven't found a place where we can specify the column type. If I write something like

  modelBuilder.Entity<ProspectAdFilter>(entity =>
  {
      entity.OwnsOne(a => a.Model, x =>
      {
          x.ToJson("ModelJson").HasColumnType("json");
      });
  }); 

It results in a an error as the property is mapped to a string in the model instead of an object.

Switching from json to jsonb is not really an option for us as it pushes the database from a measly 2Gb to a 65Gb one.

@roji
Copy link
Member

roji commented Oct 17, 2024

Duplicate of dotnet/efcore#28452

@roji roji marked this as a duplicate of dotnet/efcore#28452 Oct 17, 2024
@roji
Copy link
Member

roji commented Oct 17, 2024

This should be available on 9.0 - give 9.0.0-rc.2 a try and let me know if you're hitting issues.

@roji roji closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@roji roji added the duplicate This issue or pull request already exists label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants