Skip to content

[Feature Request] Add support for trigger on specific fields #342

@czlowiek488

Description

@czlowiek488

I have this trigger.

CREATE OR REPLACE TRIGGER user_account_encrypt_secret_trigger_email
    BEFORE INSERT OR UPDATE OF email ON user_account
    FOR EACH ROW
    EXECUTE FUNCTION user_account_encrypt_secret_email();

but it pgschema generates plan with

CREATE OR REPLACE TRIGGER user_account_encrypt_secret_trigger_email
    BEFORE INSERT OR UPDATE ON user_account
    FOR EACH ROW
    EXECUTE FUNCTION user_account_encrypt_secret_email();

as you can see OF email is gone.

So in my registration flow where I execute UPDATE query to set user verified status to TRUE trigger is being triggered and email gets encrypted once more making my user data unusable :(.

I would really appreciate fixing this since I can't really use pgschema without it.

I never wrote in Go but if someone could just tell me where I should look at I'm pretty sure I can prepare a merge request with it working.

I really love how pgschema works and what it does but if I can't make encryption work I will have no other choice and I will have to change tooling...

As a temporary workaround I created overriding migrations that i execute after plan.

Image

However it is not really convenient and I would prefer to have handled by this tool if it's possible before I will let other people work with it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions