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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@IdColumn decorator #33

Closed
MichalLytek opened this issue Sep 19, 2016 · 4 comments
Closed

@IdColumn decorator #33

MichalLytek opened this issue Sep 19, 2016 · 4 comments

Comments

@MichalLytek
Copy link
Contributor

It would be nice to have an alias @IdColumn for @PrimaryColumn("int", { generated: true }).

It should be easy to do and I think I might be able to do the PR but not know, I have to learn TypeORM better and build some app using it first 馃槈

@pleerock
Copy link
Member

It should be easy to do and I think I might be able to do the PR but not know, I have to learn TypeORM better and build some app using it first

yes, sure its much more complicated codebase and requires time to learn it

It would be nice to have an alias @IdColumn for @PrimaryColumn("int", { generated: true })

But id column means that id will have an unique identifier, right? And it isnt necessary to be generated

@MichalLytek
Copy link
Contributor Author

MichalLytek commented Sep 19, 2016

It might be named @AutoIdColumn or sth meaningfull, it's just an alias and behave the same as @PrimaryColumn("int", { generated: true }) - it creates database column id | int(11) | PRIMARY KEY AUTO_INCREMENT 馃槈

Almost everyone use auto generated int primary key in databases and the @PrimaryColumn("int", { generated: true }) syntax repeated in every class doesn't look nice and it's a pain to code it every time.

@pleerock
Copy link
Member

Almost everyone use auto generated int primary key in databases and the @PrimaryColumn("int", { generated: true }) syntax repeated in every class doesn't look nice and it's a pain to code it every time.

agree. But'll call it @GeneratedIdColumn to be more akin to generated in column options. implemented in b39e5ae

@MichalLytek
Copy link
Contributor Author

Ok, great! Thanks! 馃槂

AlexMesser pushed a commit that referenced this issue Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants