Skip to content

Error after extending User type and migration generation #615

Open
@kfrajtak

Description

@kfrajtak

Hi,

I have extended the User entity as described here:

import { Entity, Column } from "typeorm";
import { User as AccountsUser } from "@accounts/typeorm";

@Entity()
export class User extends AccountsUser {
  @Column() firstName: string;
  @Column() lastName: string;
  @Column({ type: "blob" }) profileImage: string;
}

Then I tried to generate migrations using with

npm run typeorm migration:generate -- -n 20190315.js

where typeorm is defined in package.json as follows

"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js"

and got this error

Error: Entity metadata for User#allServices was not found. Check if you specified a correct entity object and if it's connected in the connection options.

Can you help me with this problem?

Thank you,
Karel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions