Skip to content

Migration

kaythinks edited this page Apr 11, 2020 · 5 revisions

The Migration class has a single method.


public function register().

To migrate a model class simply add it to the register method like this $this->db->createTable('User'); NOTE:- It's important the string passed to the **createTable **method is the class name of the model declared in the models folder.

Here is an example,

   public function register()
{
	//$this->db->createTable('Enter Model Name Here');

	$this->db->createTable('User');	

	$this->db->createTable('Demo');	

	$this->db->createTable('Products');

	$this->db->createTable('Countries');


	//Close the Database connection
	$this->db->closeConnection();		
}

Run this composer command composer migrate tables to migrate the Model attributes into the database.

Clone this wiki locally