$filename = $path.'/'.$ts.$name.'.php';
- file_put_contents($filename, "<?php\n\nclass Migration_$ts extends \PFF\Migrations\Migration\n{\n function migrate()\n {\n }\n}\n\n");
+ $template = file_get_contents(dirname(__FILE__) . '/template');
+ $content = str_replace('%TS%', $ts, $template);
+ file_put_contents($filename, $content);
return $filename;
}
--- /dev/null
+<?php
+
+class Migration_%TS% extends \PFF\Migrations\Migration
+{
+ function migrate()
+ {
+ // $data = $this->query('SELECT * FROM table WHERE param = ?', array('value'));
+ // $this->connection->exec('CREATE TABLE table (id BIGINT AUTO_INCREMENT, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB');
+ }
+}
+