refactor: reference human id instead of email (#73)

* refactor: update api and client to reference humanIds

* fix: prevent deletion of network member

This may cause various side effects if there is data in other services
which reference this member
This commit was merged in pull request #73.
This commit is contained in:
Arjun Patel
2026-03-24 19:48:02 -07:00
committed by GitHub
parent 3bf3f16be7
commit bf0147d542
24 changed files with 666 additions and 416 deletions
+3 -3
View File
@@ -1,13 +1,13 @@
CREATE TABLE networks (
id TEXT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
admin_email VARCHAR(255) NOT NULL,
admin_human_id VARCHAR(255) NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE network_members (
network_id TEXT NOT NULL REFERENCES networks(id) ON DELETE CASCADE,
email VARCHAR(255) NOT NULL,
human_id VARCHAR(255) NOT NULL,
joined_at TIMESTAMPTZ DEFAULT NOW(),
PRIMARY KEY (network_id, email)
PRIMARY KEY (network_id, human_id)
);
@@ -0,0 +1 @@
DROP TABLE IF EXISTS network_invitations;
@@ -0,0 +1,6 @@
CREATE TABLE network_invitations (
network_id TEXT NOT NULL REFERENCES networks(id) ON DELETE CASCADE,
email VARCHAR(255) NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW(),
PRIMARY KEY (network_id, email)
);