Create base models required by the core functionality of Recog; users, posts, and flairs.
This commit includes TypeORM migrations which can be ran using yarn typeorm migration:run, using the yarn script allows TypeORM to use Typescript instead of pure Js.
Model Overview
User
The base user model is currently setup with the default username/password combination, which may change in the future depending on authentication flows.
Also contains a relationship to posts using the author_id attribute on Post, see more below.
Post
The Post entity represents simple posts with a title, markdown body and meta fields, such as author corresponding to the User model which created the post, and a many-to-many relationship to the Flair entity, see more below.
Flair
Flairs are used to group posts, the entity contains fields for value and color, with a many-to-many relationship to Posts using a join table, and a custom entity to map IDs, PostToFlair.
Create base models required by the core functionality of Recog; users, posts, and flairs.
This commit includes TypeORM migrations which can be ran using
yarn typeorm migration:run
, using theyarn
script allows TypeORM to use Typescript instead of pure Js.Model Overview
User
The base user model is currently setup with the default username/password combination, which may change in the future depending on authentication flows.
Also contains a relationship to posts using the
author_id
attribute onPost
, see more below.Post
The
Post
entity represents simple posts with a title, markdown body and meta fields, such asauthor
corresponding to theUser
model which created the post, and a many-to-many relationship to theFlair
entity, see more below.Flair
Flair
s are used to group posts, the entity contains fields forvalue
andcolor
, with a many-to-many relationship toPost
s using a join table, and a custom entity to map IDs,PostToFlair
.