update mailtemplate migration
This commit is contained in:
@@ -9,17 +9,29 @@ final class CreateMailtemplate extends AbstractMigration
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Mailtemplate");
|
||||
$table->addColumn("is_include", "int", ["null" => false, "default" => 0, "limit" => Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
|
||||
$table->addColumn("name", "string", ["null" => false, "limit" => 255]);
|
||||
$table->addColumn("description", "string", ["null" => true, "default" => true, "limit" => 1024]);
|
||||
$table->addColumn("code", "string", ["null" => false, "limit" => 64]);
|
||||
$table->addColumn("description", "string", ["null" => true, "default" => null, "limit" => 1024]);
|
||||
$table->addColumn("subject", "string", ["null" => false, "limit" => 255]);
|
||||
$table->addColumn("body", "text", ["null" => false]);
|
||||
$table->addColumn("note", "text", ["null" => false]);
|
||||
$table->addColumn("body_text", "text", ["null" => true, "default" => null]);
|
||||
$table->addColumn("body_html", "text", ["null" => true, "default" => null]);
|
||||
$table->addColumn("note", "text", ["null" => true, "default" => null]);
|
||||
$table->addColumn("create_by", "integer", ["null" => false]);
|
||||
$table->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$table->addColumn("create", "integer", ["null" => false]);
|
||||
$table->addColumn("edit", "integer", ["null" => false]);
|
||||
|
||||
$table->create();
|
||||
|
||||
$tfile = $this->table("MailtemplateFile");
|
||||
$tfile->addColumn("mailtemplate_id", "integer", ["null" => false]);
|
||||
$tfile->addColumn("file_id", "integer", ["null" => false]);
|
||||
$tfile->addColumn("filename", "string", ["null" => false]);
|
||||
$tfile->addColumn("create_by", "integer", ["null" => false]);
|
||||
$tfile->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$tfile->addColumn("create", "integer", ["null" => false]);
|
||||
$tfile->addColumn("edit", "integer", ["null" => false]);
|
||||
$tfile->create();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
@@ -30,6 +42,7 @@ final class CreateMailtemplate extends AbstractMigration
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("MailtemplateFile")->drop()->save();
|
||||
$this->table("Mailtemplate")->drop()->save();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user