2

I'm using Azure Sql Databases and Entity Framework Code First 6.1. The whole solution is deployed to Azure Web Site. I have a custom inheritor of DropCreateDatabaseAlways initializer configured for my DbContext.

In future I plan to switch to EF Migrations but it's more convenient at the moment to not worry about migrations in the early state of the project. Though the problem is that everytime database is recreated with 1GB size. I want it to be 100mb by default for the pricing reason. How can I achieve that using my setup?

Vladimir Makaev
  • 331
  • 4
  • 14
  • Take a look at [this answer](http://stackoverflow.com/questions/27617969/how-to-programatically-create-sql-azure-database-of-type-basic-standard-edition) – Ognyan Dimitrov Mar 09 '15 at 07:57

1 Answers1

0

Looks like you cannot change the behavior of the default initializer. But there are two possible options:

  1. write custom database initializer.

  2. use a standard initializer and execute custom sql after db is created:

    ALTER DATABASE [dbname] MODIFY (MAXSIZE = 100 Mb)

Community
  • 1
  • 1
Vadim K.
  • 1,081
  • 1
  • 14
  • 26