|
|
@@ -11,14 +11,14 @@ return new class extends Migration
|
|
|
*/
|
|
|
public function up(): void
|
|
|
{
|
|
|
- Schema::create('reviews', function (Blueprint $table) {
|
|
|
+ Schema::create('product_reviews', function (Blueprint $table) {
|
|
|
$table->id();
|
|
|
$table->foreignId('product_id')->constrained('products')->cascadeOnDelete();
|
|
|
$table->unsignedInteger('rating');
|
|
|
$table->text('comment');
|
|
|
+ $table->timestamp('date');
|
|
|
$table->string('reviewer_name');
|
|
|
$table->string('reviewer_email');
|
|
|
- $table->timestamps();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -27,6 +27,6 @@ return new class extends Migration
|
|
|
*/
|
|
|
public function down(): void
|
|
|
{
|
|
|
- Schema::dropIfExists('reviews');
|
|
|
+ Schema::dropIfExists('product_reviews');
|
|
|
}
|
|
|
};
|