Files
dockerfluxodecaixapro/modules/contact/database/migrations/001_create_contacts_table.php
T
2026-09-01 10:46:29 -03:00

33 lines
1.1 KiB
PHP
Executable File

<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Schema\Blueprint;
class CreateContactsTable
{
public function up()
{
if (!Capsule::schema()->hasTable('contacts')) {
Capsule::schema()->create('contacts', function (Blueprint $table) {
$table->increments('contacts_id');
$table->string('contacts_name');
$table->string('contacts_email');
$table->string('contacts_phone')->nullable();
$table->string('contacts_subject')->nullable();
$table->text('contacts_message');
$table->text('contacts_response')->nullable();
$table->string('contacts_status')->default('new'); // new, read, replied
$table->string('contacts_ip_address')->nullable();
$table->string('contacts_user_agent')->nullable();
$table->timestamp('contacts_read_at')->nullable();
$table->timestamps();
});
}
}
public function down()
{
Capsule::schema()->dropIfExists('contacts');
}
}