From ebdd767d06bd2b231bf918dfd435c39aeaab1efb Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 10 Apr 2025 22:36:58 +0200 Subject: [PATCH] Update contents table --- Blacklight/Contents.php | 3 ++ ...2844_add_created_at_updated_at_columns.php | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 database/migrations/2025_04_10_202844_add_created_at_updated_at_columns.php diff --git a/Blacklight/Contents.php b/Blacklight/Contents.php index 153ebb1ca..355df5328 100755 --- a/Blacklight/Contents.php +++ b/Blacklight/Contents.php @@ -169,6 +169,7 @@ class Contents 'contenttype' => $content['contenttype'], 'status' => $content['status'], 'ordinal' => $content['ordinal'], + 'updated_at' => now(), ] ); } @@ -187,6 +188,8 @@ class Contents 'contenttype' => $content['contenttype'], 'status' => $content['status'], 'ordinal' => $content['ordinal'], + 'created_at' => now(), + 'updated_at' => now(), ] ); } diff --git a/database/migrations/2025_04_10_202844_add_created_at_updated_at_columns.php b/database/migrations/2025_04_10_202844_add_created_at_updated_at_columns.php new file mode 100644 index 000000000..38fc2dbb4 --- /dev/null +++ b/database/migrations/2025_04_10_202844_add_created_at_updated_at_columns.php @@ -0,0 +1,28 @@ +timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('content', function (Blueprint $table) { + $table->dropTimestamps(); + }); + } +};