ariga / terraform-provider-atlas

Terraform Provider for Atlas
https://atlasgo.io
Apache License 2.0
56 stars 8 forks source link

CREATE USER / GRANT not Recognised as Change #94

Closed feigi closed 1 year ago

feigi commented 1 year ago

Hi again,

this may be intentional, but just in case it's not:

When I add something like this to my schema.sql and run a atlas migrate diff it will not be recognised as change and thus no migration file will be created:

do
$$
    begin
        create role rds_iam;
    exception
        when duplicate_object then raise notice '%, moving to next statement', sqlerrm using errcode = sqlstate;
    end
$$;

create
    user tariffservice with login;
grant rds_iam to fooservice;

create
    user tariffsink with login;
grant rds_iam to barservice;

Not a big deal, as I can create the diff file manually.

Thanks!

giautm commented 1 year ago

Yes, the main reason because atlas doesn't support for create user / role yet. :D

feigi commented 1 year ago

Alright 😄. I probably deserve a rtfm 😬. Have a nice rest of the day!