File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public function init()
2525
2626 switch (Yii::$ app ->db ->driverName ) {
2727 case 'mysql ' :
28+ case 'mariadb ' :
2829 $ this ->tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB ' ;
2930 break ;
3031 default :
Original file line number Diff line number Diff line change @@ -9,10 +9,22 @@ class m161109_121736_create_session_table extends Migration
99{
1010 public function up ()
1111 {
12+ switch ($ this ->db ->driverName ) {
13+ case 'mysql ' :
14+ case 'mariadb ' :
15+ $ dataType = 'LONGBLOB ' ;
16+ break ;
17+ case 'pgsql ' :
18+ $ dataType = 'BYTEA ' ;
19+ break ;
20+ default :
21+ $ dataType = 'TEXT ' ;
22+ }
23+
1224 $ this ->createTable ('{{%session}} ' , [
1325 'id ' => 'CHAR(40) NOT NULL PRIMARY KEY ' ,
1426 'expire ' => 'INTEGER ' ,
15- 'data ' => ' LONGBLOB ' ,
27+ 'data ' => $ dataType ,
1628 ], $ this ->tableOptions );
1729 }
1830
You can’t perform that action at this time.
0 commit comments