PHPstorm MySQL code style AND on new line

Answered

Hi!

At some point I managed to make PHPstorm put AND's in mysql JOINs on a new line, like this:

FROM tabl1
LEFT tabl2 ON css_omschrijving = ats_omschrijving
AND ats_deleted_at IS NULL

Now it's not working anymore, ANDs are placed on the same line like this:

FROM table1
LEFT JOIN table2 ON css_omschrijving = ats_omschrijving AND ats_deleted_at IS NULL

I can't find the right setting to make this work again. Can anyone tell me which setting this is?

Thanks a lot!

4 comments
Comment actions Permalink

Spent some time playing around with SQL Code Style setting but without any luck.

Could you please share a full query? Is it a .sql file or it is an injection in PHP/another language?

0
Comment actions Permalink

Yes, here's one that was formatted with ctrl + alt + L:

INSERT INTO tblwerkprocessjabloon (
wps_css_id,
wps_omschrijving
)
SELECT
css_id AS wps_css_id,
css_omschrijving AS wps_omschrijving
FROM tblcasussoort
LEFT JOIN tblwerkprocessjabloon ON css_id = wps_css_id
AND wps_omschrijving = css_omschrijving
AND wps_deleted_at IS NULL
WHERE wps_id IS NULL
AND css_id <> @css_verzuim;

It's a .sql-file

0
Comment actions Permalink

Hello,

Please take a look at my screenshot, these settings are in 'FROM clause' section.

0
Comment actions Permalink

Hi Yuriy! Thanks for looking into this.

I have tried the exact same settings but somehow the AND's are not put on a new line; are there any other setttings I'm missing? Can you maybe export your settings?

0

Please sign in to leave a comment.