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

Don't generate dbml refs for embedded schemas #50

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Don't generate dbml refs for embedded schemas #50

merged 1 commit into from
Aug 24, 2023

Conversation

DReigada
Copy link
Contributor

Currently for embedded schemas that reference other schemas, the generated dbml file is invalid.

Example:

This schema

typed_schema "my_schema" do
  embeds_many :embedded_schema, EmbeddedSchema, on_replace: :delete, primary_key: false do
    field(:my_field, :string)

    belongs_to(:other_schema, OtherSchema, primary_key: true, type: :binary_id)
  end
end

Generate a Ref "line" like the following (notice the empty string):

Ref: other_schema.id < "".other_schema_id

This PR changes the behaviour to ignore lines like this.

@DReigada DReigada changed the title fix: don't generate refs for embedded schemas Don't generate dbml refs for embedded schemas Aug 24, 2023
@fuelen fuelen merged commit ac34c30 into fuelen:main Aug 24, 2023
@fuelen
Copy link
Owner

fuelen commented Aug 24, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants