This repository has been archived on 2023-07-28. You can view files and clone it, but cannot push or open issues or pull requests.
prosody_web_admin_rest/data/phpmig_template.php

36 lines
475 B
PHP
Raw Permalink Normal View History

2021-05-20 23:21:43 +00:00
<?= "<?php "; ?>
2016-07-10 15:32:38 +00:00
use Phpmig\Migration\Migration;
class <?= $className ?> extends Migration
{
2021-05-20 23:21:43 +00:00
public $tableName = ''; // Table name
public $db;
2016-07-10 15:32:38 +00:00
2021-05-20 23:21:43 +00:00
/**
* Do the migration
*/
public function up()
{
$this->db->create($this->tableName, function($table) {
$table->timestamps();
});
}
2016-07-10 15:32:38 +00:00
2021-05-20 23:21:43 +00:00
/**
* Undo the migration
*/
public function down()
{
$this->db->dropIfExists($this->tableName);
}
2016-07-10 15:32:38 +00:00
2021-05-20 23:21:43 +00:00
/**
* Init the migration
*/
public function init()
{
$this->db = $this->container['schema'];
}
}