<?php
// database/migrations/xxxx_xx_xx_xxxxxx_add_timestamps_to_product.php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddTimestampsToProduct extends Migration
{
    public function up()
    {
        Schema::table('product', function (Blueprint $table) {
            if (!Schema::hasColumn('product', 'created_at')) {
                $table->timestamps();
            }
        });
    }

    public function down()
    {
        Schema::table('product', function (Blueprint $table) {
            $table->dropTimestamps();
        });
    }
}