bedezign / yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.
https://bedezign.github.io/yii2-audit/
Other
193 stars 112 forks source link

initial migration, postgresql doesn't have blob type #266

Closed kurrata closed 5 years ago

kurrata commented 5 years ago

root@sas-broadcast-docker:/app# ./yii migrate --migrationPath=@bedezign/yii2/audit/migrations
Yii Migration Tool (based on Yii v2.0.22)

Total 6 new migrations to be applied:
        m140829_000001_create_audit_entry
        m140829_000002_create_audit_data
        m140829_000003_create_audit_error
        m140829_000004_audit_trail
        m150522_000001_create_audit_javscript
        m150609_000001_update_audit_trail

Apply the above migrations? (yes|no) [no]:yes
*** applying m140829_000001_create_audit_entry
    > create table {{%audit_entry}} ...Exception 'yii\db\Exception' with message 'SQLSTATE[42704]: Undefined object: 7 ERROR:  type "blob" does not exist at character 384
The SQL being executed was: CREATE TABLE "audit_entry" (
        "id" serial NOT NULL PRIMARY KEY,
        "created" timestamp(0) NOT NULL,
        "start_time" double precision NULL,
        "end_time" double precision NULL,
        "duration" double precision NULL,
        "user_id" integer DEFAULT '0',
        "ip" varchar(45) NULL,
        "referrer" varchar(512) NULL,
        "origin" varchar(512) NULL,
        "url" varchar(512) NULL,
        "route" varchar(255) NULL,
        "data" BLOB NULL,
        "memory" integer NULL,
        "memory_max" integer NULL
)'

in /app/vendor/yiisoft/yii2/db/Schema.php:674

Error Info:
Array
(
    [0] => 42704
    [1] => 7
    [2] => ERROR:  type "blob" does not exist at character 384
)

Stack trace:
#0 /app/vendor/yiisoft/yii2/db/Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'CREATE TABLE "a...')
#1 /app/vendor/yiisoft/yii2/db/Command.php(1091): yii\db\Command->internalExecute('CREATE TABLE "a...')
#2 /app/vendor/yiisoft/yii2/db/Migration.php(323): yii\db\Command->execute()
#3 /app/vendor/bedezign/yii2-audit/migrations/m140829_000001_create_audit_entry.php(32): yii\db\Migration->createTable('{{%audit_entry}...', Array, NULL)
#4 /app/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(725): m140829_000001_create_audit_entry->up()
#5 /app/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m140829_000001_...')
#6 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#7 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /app/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /app/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#10 /app/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
#11 /app/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#12 /app/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#13 /app/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#14 /app/yii(23): yii\base\Application->run()
#15 {main}
`
kurrata commented 5 years ago

Figured out what is happening. When you install thought composer with @stable it gives you ancient 0.1.6 version

Blizzke commented 5 years ago

Closing this, 1.1.2 is released.