Categories
Mastering Development

How to relate in sequelize

I am trying to relate my Users model with the Posts model, what I want to do is that the user when creating a post saves the post id in the ‘posteds’ field of the user model, but I can’t do it Post Table: ‘posteds’ shouldn’t be there, it should be in the users table […]

Categories
Database Development

How to prevent seek pagination from doing sequential scan over entire table

I have 3 tables and a materialized view resource_categories contains all category names and metadata create table if not exists resource_categories ( category_id INT, title VARCHAR(255), content TEXT, icon VARCHAR(50) ); resources contains all resources under each category create table if not exists resources ( resource_id INT, title VARCHAR(255), content TEXT, link VARCHAR(1000), category_id INT […]