Skip to content

Commit

Permalink
fix: rename migration and add username
Browse files Browse the repository at this point in the history
  • Loading branch information
eranshmil committed Mar 16, 2019
1 parent 2422189 commit 09366c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MigrationInterface, QueryRunner, Table } from 'typeorm';

import { generateEnumQuery, getEnumName } from '../core';

export class CreateReportersTable1552670893473 implements MigrationInterface {
export class FirstVersion1552670893473 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await this._createEnums(queryRunner);
await this._createTables(queryRunner);
Expand Down Expand Up @@ -92,6 +92,12 @@ export class CreateReportersTable1552670893473 implements MigrationInterface {
length: '30',
isNullable: false
},
{
name: 'username',
type: 'varchar',
length: '30',
isNullable: true
},
{
name: 'post_id',
type: 'varchar',
Expand Down
5 changes: 4 additions & 1 deletion src/models/user-status.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export class UserStatus {
@Column({ name: 'user_id', type: 'varchar', length: 30, nullable: false })
public userId: string;

@Column({ type: 'varchar', length: 30, nullable: true })
public username?: string;

@Column({ name: 'post_id', type: 'varchar', length: 30, nullable: false })
public postId: string;

Expand All @@ -26,7 +29,7 @@ export class UserStatus {
public reasons: Reason[];

@Column({ type: 'enum', enum: Status, nullable: false })
public status: Status;
public status?: Status;

@Column({ type: 'varchar', length: 200, nullable: true })
public description?: string;
Expand Down

0 comments on commit 09366c5

Please sign in to comment.