I am writing Web app. My program creates relations itself when it is needed, basically when the program is deployed and run first t开发者_开发问答ime. But I see that it is very common to create SQL script and run it to initialize data-base for the first time. Is it compulsory to do this?
No, it is not compulsory for the database initialization script to be part of the "first run" of your application; preparing the database can be a deployment step. In fact, depending how long it takes to initialize the database, you might specifically want to avoid initializing the database on the first run, and instead make sure it is deployed and initialized before the first time the application is accessed.
精彩评论