You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When clicking the Prune old records button in the admin CP, I get the following error:
PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column "datecreated" does not exist
LINE 3: WHERE dateCreated <= $1
^
HINT: Perhaps you meant to reference the column "audit_log.dateCreated". in /app/craftcms/vendor/yiisoft/yii2/db/Command.php:1302
Stack trace:
#0 /app/craftcms/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
#1 /app/craftcms/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT COUNT(*)...')
#2 /app/craftcms/vendor/yiisoft/yii2/db/Command.php(436): yii\db\Command->queryInternal('fetchColumn', 0)
#3 /app/craftcms/vendor/yiisoft/yii2/db/Query.php(497): yii\db\Command->queryScalar()
#4 /app/craftcms/vendor/yiisoft/yii2/db/ActiveQuery.php(352): yii\db\Query->queryScalar('COUNT(*)', Object(craft\db\Connection))
#5 /app/craftcms/vendor/yiisoft/yii2/db/Query.php(368): yii\db\ActiveQuery->queryScalar('COUNT(*)', Object(craft\db\Connection))
#6 /app/craftcms/vendor/superbig/craft-audit/src/services/AuditService.php(500): yii\db\Query->count()
#7 /app/craftcms/vendor/superbig/craft-audit/src/controllers/DefaultController.php(98): superbig\audit\services\AuditService->pruneLogs()
#8 [internal function]: superbig\audit\controllers\DefaultController->actionPruneLogs()
#9 /app/craftcms/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /app/craftcms/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#11 /app/craftcms/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('prune-logs', Array)
#12 /app/craftcms/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('audit/default/p...', Array)
#13 /app/craftcms/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('audit/default/p...', Array)
#14 /app/craftcms/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest(Object(craft\web\Request))
#15 /app/craftcms/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#16 /app/craftcms/web/index.php(24): yii\base\Application->run()
#17 {main}
Next yii\db\Exception: SQLSTATE[42703]: Undefined column: 7 ERROR: column "datecreated" does not exist
LINE 3: WHERE dateCreated <= $1
^
HINT: Perhaps you meant to reference the column "audit_log.dateCreated".
The SQL being executed was: SELECT COUNT(*)
FROM "audit_log"
WHERE dateCreated <= '2022-05-10 08:33:44' in /app/craftcms/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /app/craftcms/vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException(Object(PDOException), 'SELECT COUNT(*)...')
#1 /app/craftcms/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute('SELECT COUNT(*)...')
#2 /app/craftcms/vendor/yiisoft/yii2/db/Command.php(436): yii\db\Command->queryInternal('fetchColumn', 0)
#3 /app/craftcms/vendor/yiisoft/yii2/db/Query.php(497): yii\db\Command->queryScalar()
#4 /app/craftcms/vendor/yiisoft/yii2/db/ActiveQuery.php(352): yii\db\Query->queryScalar('COUNT(*)', Object(craft\db\Connection))
#5 /app/craftcms/vendor/yiisoft/yii2/db/Query.php(368): yii\db\ActiveQuery->queryScalar('COUNT(*)', Object(craft\db\Connection))
#6 /app/craftcms/vendor/superbig/craft-audit/src/services/AuditService.php(500): yii\db\Query->count()
#7 /app/craftcms/vendor/superbig/craft-audit/src/controllers/DefaultController.php(98): superbig\audit\services\AuditService->pruneLogs()
#8 [internal function]: superbig\audit\controllers\DefaultController->actionPruneLogs()
#9 /app/craftcms/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /app/craftcms/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#11 /app/craftcms/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('prune-logs', Array)
#12 /app/craftcms/vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('audit/default/p...', Array)
#13 /app/craftcms/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('audit/default/p...', Array)
#14 /app/craftcms/vendor/craftcms/cms/src/web/Application.php(278): yii\web\Application->handleRequest(Object(craft\web\Request))
#15 /app/craftcms/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#16 /app/craftcms/web/index.php(24): yii\base\Application->run()
#17 {main}
Additional Information:
Array
(
[0] => 42703
[1] => 7
[2] => ERROR: column "datecreated" does not exist
LINE 3: WHERE dateCreated <= $1
^
HINT: Perhaps you meant to reference the column "audit_log.dateCreated".
)
Plugin
Version 1.1.3
Application Info
PHP version 8.0.10
OS version Linux 5.10.104-linuxkit
Database driver & version PostgreSQL 13.2
Image driver & version Imagick 3.5.1 (ImageMagick 7.0.11-13)
Craft edition & version Craft Pro 3.7.44
Yii version 2.0.45
Twig version v2.14.13
Guzzle version 7.4.3
sjelfull
changed the title
Database exception thrown when attempting to prune old records
[PLU-1] Database exception thrown when attempting to prune old records
Nov 21, 2023
When clicking the Prune old records button in the admin CP, I get the following error:
Plugin
Version 1.1.3
Application Info
PLU-1
The text was updated successfully, but these errors were encountered: