Skip to content

isaac-allef/typeorm-single-table-inheritance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeORM Single Table Inheritance

Learn how to implement single table inheritance in TypeORM

📌 Table of Contents

🚀 Features

  • Use single table inheritance in order to create database schema

📙 Class Diagram

In order to better visualize the class inheritance scheme, I've created the following class diagram:

📋 Database Model

In order to understand how the database schema would look using single table inheritance, I've created the following database models:

👷 Installation

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-single-table-inheritance.git

# Go into the repository
$ cd typeorm-single-table-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 single-table-inheritance -e POSTGRES_PASSWORD=1234 -p 5433:5432 -d postgres

# Create 'users' database
$ CREATE DATABASE academy-single-table-inheritance;

🏃 Getting Started

Run the transactions in order to configure the database schema

yarn typeorm migration:run

📮 Faq

Question: What are the tecnologies used in this project?

Answer: The tecnologies used in this project are NodeJS, Typescript and TypeORM

📕 License

📝 License

This project is under the MIT license. See the LICENSE for more information.


Made with ♥ by Isaac Allef 👋

About

Learn how to implement single table inheritance in TypeORM.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published