Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

typeorm - Do not create non existent tables

By default, if table that defined in model, does not exist, typeorm would create it. I want all tables to be only created by migrations. If I misspell table name in model declaration, I want some kind of error no be thrown. Is it possible to turn off auto table creation feature?

question from:https://stackoverflow.com/questions/65648348/do-not-create-non-existent-tables

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm not sure I fully understand your question, but to turn off the auto table creation you only have to make synchronize to false in configuration file synchronize: false,


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...