Skip to content

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

@davidsparkles

Description

@davidsparkles

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.

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