Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(database): tag model
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelo Magtoto committed Oct 13, 2022
1 parent 062c997 commit e695899
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions database/models/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
Table,
Model,
Column,
HasMany,
BelongsToMany
} from "sequelize-typescript"
import Post from "%/models/post"
// import PostTag from "%/models/post_tag"

@Table({
"timestamps": true,
"paranoid": true
})
export default class Tag extends Model {
@Column({
"unique": true,
"allowNull": false
})
name!: string

// @HasMany(() => PostTag)
// postTags!: PostTag[]

// @BelongsToMany(() => Post, () => PostTag)
// post!: Post[]
}

0 comments on commit e695899

Please sign in to comment.