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

Multi-column primary key #15

Closed
andreasrueedlinger opened this issue Aug 4, 2016 · 3 comments
Closed

Multi-column primary key #15

andreasrueedlinger opened this issue Aug 4, 2016 · 3 comments

Comments

@andreasrueedlinger
Copy link

Hi, I really like the idea behind your project and your effort you put in.
A question about primary keys (since they are required by your framework): are multi-column primary keys supported?
Do you just annotate two or more columns with the @PrimaryKey decorator?

@pleerock
Copy link
Member

pleerock commented Aug 4, 2016

Hey, yeap I have it in plans in my long todos list here, but not sure when I can push it since there are lot of other work right now

@dkirchhof
Copy link

Hello,
i came accross a problem when using inheritance. It seems that a composite primary key is not generated if one column is defined in a parent and one in a child class.
Example:

// no decorator
export abstract class RatingBase
{
    @PrimaryColumn()
    public userId: string;

    @Column()
    public value: number;
}

@Entity("course_ratings")
export class CourseRating extends RatingBase
{
    @PrimaryColumn()
    public courseId: string;
}

@Kononnable
Copy link
Contributor

Kononnable commented Sep 28, 2018

@dkirchhof Please create separate issue. Not many people will look in old, closed issues and it's easier to maintenance if different problems(they're connected, but are not the same) are kept in different issues.

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

No branches or pull requests

4 participants