Learn how to implement inheritance in TypeORM
- Use inheritance in order to create database schema
In order to better visualize the class inheritance scheme, I've created the following class diagram:
In order to understand how the database schema would look, I've created the following database models:
You need to install Node.js and Yarn first, then in order to clone the project via HTTPS, run this command:
# Clone this repository
git clone https://github.com/isaac-allef/typeorm-inheritance.git
# Go into the repository
$ cd typeorm-inheritance
# Install dependencies
yarn install
Setup a database
Install Postgres to create a database or if you have Docker in your machine, fill the environment values related to database configurations and then run the following commands in order to create a Postgres container.
# Create postgres docker
$ sudo docker run --name typeorm-inheritance -e POSTGRES_PASSWORD=1234 -p 5433:5432 -d postgres
# Create 'users' database
$ CREATE DATABASE academy;
Run the transactions in order to configure the database schema
yarn typeorm migration:run
Question: What are the tecnologies used in this project?
Answer: The tecnologies used in this project are NodeJS, Typescript and TypeORM
This project is under the MIT license. See the LICENSE for more information.
Made with ♥ by Isaac Allef 👋