Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Creating Index via Decorator seems not to work #126

Open
davidsparkles opened this issue Nov 8, 2019 · 0 comments
Open

Bug: Creating Index via Decorator seems not to work #126

davidsparkles opened this issue Nov 8, 2019 · 0 comments
Labels

Comments

@davidsparkles
Copy link
Collaborator

Package

  • db

Describe the bug

No database index is created when using the Index decorator. see example below.

To Reproduce

The following should create an index like CREATE INDEX ON "Investment" ("projectId");, but the index is not created:

import { Entity, ManyToOne, PrimaryGeneratedColumn, BaseEntity, Index } from "@fullstack-one/db";
import { Emission } from "./Emission";

@Entity()
export default class Investment extends BaseEntity {
  @PrimaryGeneratedColumn()
  public readonly id!: string;

  @ManyToOne((type) => Emission, "investments", { nullable: false, lazy: true })
  @Index()
  public emission!: Promise<Emission>;
}

Expected behavior
Index should be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant