-- Table: public.accounts
DROP TABLE IF EXISTS public.accounts;

CREATE TABLE IF NOT EXISTS public.accounts
(
    id   UUID DEFAULT uuidv7(),
    name VARCHAR(50) NOT NULL,
    amount  NUMERIC(19, 2) NOT NULL,
    CONSTRAINT pk_contact_types PRIMARY KEY (id)
);

ALTER TABLE IF EXISTS public.accounts
    OWNER to role_owner;

-- Revoke all permissions from existing roles
REVOKE ALL ON TABLE public.accounts FROM role_service, role_support;

-- Grant appropriate permissions
GRANT ALL ON TABLE public.accounts TO role_maintainer;
GRANT SELECT, INSERT, UPDATE ON TABLE public.accounts TO role_service;
GRANT SELECT ON TABLE public.accounts TO role_support;
