bf0147d542
* 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
14 lines
374 B
SQL
14 lines
374 B
SQL
CREATE TABLE networks (
|
|
id TEXT PRIMARY KEY,
|
|
name 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,
|
|
human_id VARCHAR(255) NOT NULL,
|
|
joined_at TIMESTAMPTZ DEFAULT NOW(),
|
|
PRIMARY KEY (network_id, human_id)
|
|
);
|