feat(shared) : add column comments catalog helper for migrations
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Infrastructure\Database;
|
||||
|
||||
final class ColumnCommentsCatalog
|
||||
{
|
||||
/**
|
||||
* SQL `COMMENT ON COLUMN` statements for the 4 standard Timestampable/Blamable columns.
|
||||
* Call from a migration: foreach (...) { $this->addSql($statement); }.
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function timestampableBlamableComments(string $table): array
|
||||
{
|
||||
return [
|
||||
"COMMENT ON COLUMN {$table}.created_at IS 'Date de creation (UTC). Rempli automatiquement (Timestampable).'",
|
||||
"COMMENT ON COLUMN {$table}.updated_at IS 'Date de derniere modification (UTC). Rempli automatiquement (Timestampable).'",
|
||||
"COMMENT ON COLUMN {$table}.created_by IS 'Auteur de la creation (FK user, SET NULL). Rempli automatiquement (Blamable).'",
|
||||
"COMMENT ON COLUMN {$table}.updated_by IS 'Auteur de la derniere modification (FK user, SET NULL). Rempli automatiquement (Blamable).'",
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user