File: /home/accemeff/vendor/craftcms/cms/src/updates/migration.php.template
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\migrations;
/**
* This view is used by app/console/controllers/MigrateController.php.
*
* The following variables are available in this view:
*/
/** @var $namespace string The namespace of the generated migration. */
/** @var $className string The new migration class name. */
/** @var $migrationNameDesc string The format of the migration class name. */
echo "<?php\n";
?>
namespace <?= $namespace ?>;
use Craft;
use craft\db\Migration;
/**
* <?= $className ?> migration.
*/
class <?= $className ?> extends Migration
{
/**
* @inheritdoc
*/
public function safeUp()
{
<?php if ($isInstall) { ?>
// Place installation code here...
<?php } else { ?>
// Place migration code here...
<?php } ?>
}
/**
* @inheritdoc
*/
public function safeDown()
{
<?php if ($isInstall) { ?>
// Place uninstallation code here...
<?php } else { ?>
echo "<?= $className ?> cannot be reverted.\n";
return false;
<?php } ?>
}
}