first commit

This commit is contained in:
zickkeen committed 2024-03-17 11:39:27 +07:00
commit d0e185820a
2710 files changed
+465112

No files matched your search

@@ -0,0 +1,62 @@
<?php
use Migrations\AbstractMigration;
class Version130 extends AbstractMigration
{
public $autoId = false;
public function up()
{
$this->execute("SET SESSION sql_mode = ''");
$options = $this->table('options');
$rows = [
[
'name' => 'email_from',
'value' => 'no_reply@' . env('HTTP_HOST', 'localhost'),
],
[
'name' => 'email_method',
'value' => 'default',
],
[
'name' => 'email_smtp_host',
'value' => '',
],
[
'name' => 'email_smtp_port',
'value' => '',
],
[
'name' => 'email_smtp_username',
'value' => '',
],
[
'name' => 'email_smtp_password',
'value' => '',
],
];
$options->insert($rows);
$options->saveData();
}
public function down()
{
$this->execute("SET SESSION sql_mode = ''");
$table_prefix = $this->getAdapter()->getOption('table_prefix');
$items = implode(",", [
"'email_from'",
"'email_method'",
"'email_smtp_host'",
"'email_smtp_port'",
"'email_smtp_username'",
"'email_smtp_password'",
]);
$this->execute("DELETE FROM `{$table_prefix}options` WHERE `name` IN ({$items});");
}
}