-
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.
- Loading branch information
1 parent
1b052f7
commit 0afc18a
Showing
2 changed files
with
37 additions
and
0 deletions.
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,26 @@ | ||
import {MigrationInterface, QueryRunner, Table} from "typeorm"; | ||
|
||
export class createCountry1637764436028 implements MigrationInterface { | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.createTable(new Table({ | ||
name: "country", | ||
columns: [ | ||
{ | ||
name: "id", | ||
type: "int", | ||
isPrimary: true | ||
}, | ||
{ | ||
name: "name", | ||
type: "varchar", | ||
} | ||
] | ||
}), true) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.dropTable("country"); | ||
} | ||
|
||
} |
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 Country | ||
{ | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
} |