CREATE TYPE raid_builder.account_permission_type AS ENUM ( 'ADMIN', 'USER' );


CREATE TABLE IF NOT EXISTS raid_builder.account_permission(
	account_permission_id uuid PRIMARY KEY,
	account_id uuid REFERENCES raid_builder.account(account_id) NOT NULL,
	account_permission_type raid_builder.account_permission_type NOT NULL
);

CREATE INDEX idx_account_permission_account_id ON raid_builder.account_permission(account_id);

GRANT ALL ON TABLE raid_builder.account_permission TO raid_builder;
