ucas
ucas

Reputation: 487

SQL script initializing a database for the first time

I am writing Web app. My program creates relations itself when it is needed, basically when the program is deployed and run first time. 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?

Upvotes: 3

Views: 1715

Answers (1)

Boris Nikolaevich
Boris Nikolaevich

Reputation: 1461

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.

Upvotes: 5

Related Questions