Skip to content

Commit

Permalink
🗃️ chore: added activeContacts table schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rezk2ll committed Jul 8, 2024
1 parent 4161d4f commit f36b4a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/matrix-identity-server/src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type Collections =
| 'roomTags'
| 'userHistory'
| 'userQuotas'
| 'activeContacts'

const cleanByExpires: Collections[] = ['oneTimeTokens', 'attempts']

Expand Down
3 changes: 2 additions & 1 deletion packages/matrix-identity-server/src/db/sql/sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const tables: Record<Collections, string> = {
roomTags:
'id varchar(64) PRIMARY KEY, authorId varchar(64), content text, roomId varchar(64)',
userHistory: 'address text PRIMARY KEY, active integer, timestamp integer',
userQuotas: 'user_id varchar(64) PRIMARY KEY, size int'
userQuotas: 'user_id varchar(64) PRIMARY KEY, size int',
activeContacts: 'userId text PRIMARY KEY, contacts text'
}

const indexes: Partial<Record<Collections, string[]>> = {
Expand Down
3 changes: 2 additions & 1 deletion packages/tom-server/src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const initializeDb = (server: TwakeServer): Promise<void> => {
roomTags:
'id varchar(64) PRIMARY KEY, authorId varchar(64), content text, roomId varchar(64)',
userQuotas: 'user_id varchar(64) PRIMARY KEY, size int',
rooms: 'id varchar(64) PRIMARY KEY, filter varchar(64)'
rooms: 'id varchar(64) PRIMARY KEY, filter varchar(64)',
activeContacts: 'userId text PRIMARY KEY, contacts text'
},
{},
{},
Expand Down

0 comments on commit f36b4a9

Please sign in to comment.