How can I create an entity? #2472
-
Hi everyone, I'm newbie, I tried to create a new entity follow by this guide Create an entity, when I try to Create a Migration npx typeorm migration:create -n AddPost --dir src/migrations It return file Migration with nothing todo look like: Please, give me an idea to help me for passing this step. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The That being said, you can let Typeorm generate migrations for you by running their |
Beta Was this translation helpful? Give feedback.
The
create
command from Typeorm generates empty migrations, so this is expected. We recommend you write your own queries within these migrations to ensure you achieve exactly what you are aiming for.That being said, you can let Typeorm generate migrations for you by running their
generate
command. Though, it requires additional configuration steps including setting up a DataSource. You can read more about it in their documentation here.