From 51ede2245f13e5262d73c0fb862eab2e348e23dd Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Fri, 4 Jul 2025 09:56:26 +0800 Subject: [PATCH] update --- ...04_092108_create_email_templates_table.php | 39 +++++++++++++++++++ ...7_04_092917_create_email_records_table.php | 37 ++++++++++++++++++ ...092918_create_email_record_users_table.php | 39 +++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 database/migrations/2025_07_04_092108_create_email_templates_table.php create mode 100644 database/migrations/2025_07_04_092917_create_email_records_table.php create mode 100644 database/migrations/2025_07_04_092918_create_email_record_users_table.php diff --git a/database/migrations/2025_07_04_092108_create_email_templates_table.php b/database/migrations/2025_07_04_092108_create_email_templates_table.php new file mode 100644 index 0000000..8904d84 --- /dev/null +++ b/database/migrations/2025_07_04_092108_create_email_templates_table.php @@ -0,0 +1,39 @@ +id(); + // 标题 + $table->string('title')->nullable()->comment('标题'); + // 描述 + $table->string('description')->nullable()->comment('描述'); + // 内容 + $table->mediumText('content')->nullable()->comment('内容'); + // 可用变量 + $table->string('var')->nullable()->comment('可用变量'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('email_templates'); + } +}; diff --git a/database/migrations/2025_07_04_092917_create_email_records_table.php b/database/migrations/2025_07_04_092917_create_email_records_table.php new file mode 100644 index 0000000..d1e1bac --- /dev/null +++ b/database/migrations/2025_07_04_092917_create_email_records_table.php @@ -0,0 +1,37 @@ +id(); + // 发送时间 + $table->dateTime('time')->nullable()->comment('发送时间'); + // 邮件主题 + $table->string('subject')->nullable()->comment('邮件主题'); + // 邮件模版id + $table->integer('email_template_id')->nullable()->comment('邮件模版id'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('email_records'); + } +}; diff --git a/database/migrations/2025_07_04_092918_create_email_record_users_table.php b/database/migrations/2025_07_04_092918_create_email_record_users_table.php new file mode 100644 index 0000000..47fb7d5 --- /dev/null +++ b/database/migrations/2025_07_04_092918_create_email_record_users_table.php @@ -0,0 +1,39 @@ +id(); + // 发送配置id + $table->integer('email_record_id')->nullable()->comment('发送记录id'); + // 接收用户id + $table->integer('user_id')->nullable()->comment('接收用户id'); + // 状态 + $table->tinyInteger('status')->nullable()->comment('状态0:待发送1:成功 2:失败'); + // 发送时间 + $table->dateTime('send_time')->nullable()->comment('发送时间'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('email_records'); + } +};