Created
December 13, 2017 13:07
-
-
Save leolabs/ca68b7a536ef350015dc2353f661aabe to your computer and use it in GitHub Desktop.
CodeIgniter Migration Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
#set($name = ${NAME}) | |
#set($className = $name.replaceAll("[0-9]+_", "")) | |
class Migration_$className extends CI_Migration { | |
public function __construct() { | |
parent::__construct(); | |
\$this->load->dbforge(); | |
} | |
public function up() { | |
\$sqlSteps = [ | |
#[[$END$]]# | |
]; | |
foreach (\$sqlSteps as \$step) { | |
if(!\$this->db->query(\$step)) return false; | |
} | |
return true; | |
} | |
public function down() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment