Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest 1.0.23 migration update fails #91

Closed
CodyMcMichael opened this issue May 2, 2019 · 2 comments
Closed

Latest 1.0.23 migration update fails #91

CodyMcMichael opened this issue May 2, 2019 · 2 comments

Comments

@CodyMcMichael
Copy link

Craft Version: 3.0.41.1
Postgres Version: 9.6

Hey I'm updating an existing app that has existing redirect data. Whenever I try to update the plugin to 1.0.23, the migration fails and logs this from my container.

cg-postgres | ERROR:  syntax error at or near "NOT" at character 77
cg-postgres | STATEMENT:  ALTER TABLE "dolphiq_redirects" ALTER COLUMN "sourceUrl" TYPE varchar(1000) NOT NULL DEFAULT ''

I bumped back to 1.0.20 which seems to be the latest stable version for now and everything works as expected. Just thought you would like to know. Thanks

@peimansh
Copy link

peimansh commented Sep 9, 2019

Exactly same issue here.
Output Log from migration failure:

Database Exception: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "NOT"
LINE 1: ...ects" ALTER COLUMN "sourceUrl" TYPE varchar(1000) NOT NULL D...
^
The SQL being executed was: ALTER TABLE "craft_dolphiq_redirects" ALTER COLUMN "sourceUrl" TYPE varchar(1000) NOT NULL DEFAULT ''

Migration: dolphiq\redirect\migrations\m190426_121317_change_url_size_to_1000

Output:

> alter column sourceUrl in table {{%dolphiq_redirects}} to string(1000) NOT NULL DEFAULT '' ...Exception: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "NOT"
LINE 1: ...ects" ALTER COLUMN "sourceUrl" TYPE varchar(1000) NOT NULL D...
^
The SQL being executed was: ALTER TABLE "craft_dolphiq_redirects" ALTER COLUMN "sourceUrl" TYPE varchar(1000) NOT NULL DEFAULT '' (/var/www/vendor/yiisoft/yii2/db/Schema.php:664)
#0 /var/www/vendor/yiisoft/yii2/db/Command.php(1263): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE "cr...')
#1 /var/www/vendor/yiisoft/yii2/db/Command.php(1075): yii\db\Command->internalExecute('ALTER TABLE "cr...')
#2 /var/www/vendor/yiisoft/yii2/db/Migration.php(420): yii\db\Command->execute()
#3 /var/www/vendor/dolphiq/redirect/src/migrations/m190426_121317_change_url_size_to_1000.php(22): yii\db\Migration->alterColumn('{{%dolphiq_redi...', 'sourceUrl', Object(yii\db\ColumnSchemaBuilder))
#4 /var/www/vendor/craftcms/cms/src/db/Migration.php(56): dolphiq\redirect\migrations\m190426_121317_change_url_size_to_1000->safeUp()
...

Craft CMS version: 3.0.35
Postgres: 10.5
It happens when updating to 1.0.23

@tarmooo
Copy link

tarmooo commented Oct 8, 2019

Had the same issue when upgrading to 1.0.23(craft: 3.3.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants