yii-starter-kit / yii2-starter-kit

Yii2 Starter Kit
http://yii2-starter-kit.terentev.net
Other
1.42k stars 648 forks source link

Make migrations RDBMS agnostic #739

Open zabdurakhimov opened 4 years ago

zabdurakhimov commented 4 years ago

This migration fails on PostgreSql database version 12 stating that

alter column slug in table {{%article}} to string(255) NOT NULL ...Exception: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error (near: "NOT") LINE 1: ...BLE "article" ALTER COLUMN "slug" TYPE varchar(255) NOT NULL

It runs with mysql database with no error though. A possible solution might be placing a condition for checking and running the query in accordance with db type

XzAeRo commented 4 years ago

There are several things that are mysql specific. Definitely planning to fix this in the next update.