-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: create model publisher #29 * feat: load Category
- Loading branch information
1 parent
4f97d9e
commit 2a57eeb
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {MigrationInterface, QueryRunner, Table} from "typeorm"; | ||
|
||
export class createPublisher1637764570648 implements MigrationInterface { | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.createTable(new Table({ | ||
name: "publisher", | ||
columns: [ | ||
{ | ||
name: "id", | ||
type: "int", | ||
isPrimary: true | ||
}, | ||
{ | ||
name: "name", | ||
type: "varchar", | ||
} | ||
] | ||
}), true) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.dropTable("publisher"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'; | ||
|
||
@Entity() | ||
export class Publisher | ||
{ | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
} |