📄️ Database Setup & Connection
We have our Repository layer, but it's currently pushing data into a JavaScript array. If you restart the server, all data is lost.
📄️ Defining Models
In Sequelize, a Model is a JavaScript class that represents a table in your database. It defines the columns (title, content) and their data types (String, Text, Integer).
📄️ Migrations
We have defined our Post model in JavaScript, but if you check your PostgreSQL database, the Posts table does not exist yet.
📄️ Refactoring the Repository
We have a running PostgreSQL database and a Posts table. However, our application is still saving data to a fake JavaScript array in src/repositories/post.repository.js.