vimerate
11/11/2024, 4:07 AMlldap to 0.6.0 running Postgres - the issue I'm running into is where Postgres doesn't support the DELETE ... LIMIT the migrate_to_v8 function is using. Is there an alternative DML I can run to accomplish the same thing?vimerate
11/11/2024, 4:34 AMsql
BEGIN;
ALTER TABLE lldap.memberships ADD COLUMN id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY;
DELETE FROM lldap.memberships a USING lldap.memberships b WHERE a.id < b.id AND a.user_id = b.user_id AND a.group_id = b.
group_id;
ALTER TABLE lldap.memberships DROP COLUMN id;
CREATE UNIQUE INDEX "unique-memberships" ON lldap.memberships (user_id, group_id);
UPDATE lldap.metadata SET VERSION = 8;
COMMIT;