<?php
// app/schemas/skutoproducts.php

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;

/**
 * Schema definition for the 'skutoproducts' table.
 * Define your table structure using Doctrine DBAL's fluent API.
 *
 * Available types (case-insensitive):
 * string, text, integer, smallint, bigint, float, decimal, boolean,
 * datetime, datetime_immutable, date, date_immutable, time, time_immutable,
 * guid, binary, blob, json, array (for serializing PHP arrays)
 */
return function (Schema $schema, Table $table) {
    // $table->setName('skutoproducts');

    $table->addColumn("id", "integer", ["autoincrement" => true, "notnull" => true]);
    $table->addColumn("name", "string", ["length" => 255, "notnull" => true]);
    $table->addColumn("email", "string", ["length" => 255, "notnull" => true]);
    $table->addColumn("password", "string", ["length" => 255, "notnull" => true]);
    $table->addColumn("created_at", "datetime_immutable", ["default" => "CURRENT_TIMESTAMP", "notnull" => true]);
    // For 'updated_at' with ON UPDATE CURRENT_TIMESTAMP, Doctrine DBAL doesn't support it directly.
    // Define it here without 'onUpdate', and add raw SQL in the migration file if needed for MySQL.
    $table->addColumn("updated_at", "datetime_immutable", ["default" => "CURRENT_TIMESTAMP", "notnull" => true]);

    $table->setPrimaryKey(["id"]);
    $table->addUniqueIndex(["email"], "UNIQ_USER_EMAIL");
    $table->addIndex(["name"], "IDX_USER_NAME");
};