diff --git a/src/Shared/Infrastructure/Database/ColumnCommentsCatalog.php b/src/Shared/Infrastructure/Database/ColumnCommentsCatalog.php new file mode 100644 index 0000000..16d070e --- /dev/null +++ b/src/Shared/Infrastructure/Database/ColumnCommentsCatalog.php @@ -0,0 +1,24 @@ +addSql($statement); }. + * + * @return list + */ + 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).'", + ]; + } +} diff --git a/tests/Unit/Shared/Database/ColumnCommentsCatalogTest.php b/tests/Unit/Shared/Database/ColumnCommentsCatalogTest.php new file mode 100644 index 0000000..bb41001 --- /dev/null +++ b/tests/Unit/Shared/Database/ColumnCommentsCatalogTest.php @@ -0,0 +1,33 @@ +