Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Create database on first Migration

$
0
0
Hello, everyone.

Is there a way to create the database by runing a migration in the application startup? In this case I want to create the main application's database, not a secondary one, that is, my first migration will be responsible to create the database.

I'm coming from .NET and I used to use Entity Framework Migration to handle all the database 'actions', like creating and updating it. In the first execution, if the database do not exists, EF Migrations creates it for me.

I tried to create a migration to do it, but to make it work I first need to configure the database connection on config/database.php, seting the database name. But I do not have a database initially! I want the migrations create it for me.

Thank you all. =)

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>