I’m working on a feature where users can hide specific requests, and I’m trying to ensure my database design supports scalability and extensibility. Below are my current tables:
Requests Table
Column Name | Data Type | Description |
---|---|---|
id |
INT (Primary) | Unique identifier for the request. |
request |
TEXT | The content of the search request. |
created_at |
DATETIME | Timestamp of when the request was created. |
Users Table
Column Name | Data Type | Description |
---|---|---|
id |
INT (Primary) | Unique identifier for the user. |
name |
VARCHAR(255) | Name of the user. |
email |
VARCHAR(255) | Email of the user. |
UserRequestActions Table
Column Name | Data Type | Description |
---|---|---|
id |
INT (Primary) | Unique identifier for the record. |
user_id |
INT (Foreign) | ID of the user performing the action. |
request_id |
INT (Foreign) | ID of the request on which the action is performed. |
action |
ENUM | The type of action (e.g., ‘hide’, ‘decline’). |
metadata |
JSON | Optional details related to the action. |
created_at |
DATETIME | Timestamp of when the action was performed. |
I want to query all requests where the id
is not in the UserRequestActions
table for the current user, specifically where the action
is hide
.
Here’s my current query:
it is working but not sure if it correct for bubble