2323
2424use Crate \DBAL \Types \MapType ;
2525use Crate \DBAL \Types \TimestampType ;
26- use Doctrine \DBAL \DBALException ;
26+ use Doctrine \DBAL \Exception ;
2727use Doctrine \DBAL \Event \SchemaCreateTableColumnEventArgs ;
2828use Doctrine \DBAL \Event \SchemaCreateTableEventArgs ;
2929use Doctrine \DBAL \Events ;
@@ -76,7 +76,7 @@ public function getSubstringExpression($value, $from = 0, $length = null)
7676 */
7777 public function getNowExpression ()
7878 {
79- throw DBALException ::notSupported (__METHOD__ );
79+ throw Exception ::notSupported (__METHOD__ );
8080 }
8181
8282 /**
@@ -92,7 +92,7 @@ public function getRegexpExpression()
9292 */
9393 public function getDateDiffExpression ($ date1 , $ date2 )
9494 {
95- throw DBALException ::notSupported (__METHOD__ );
95+ throw Exception ::notSupported (__METHOD__ );
9696 }
9797
9898 /**
@@ -146,14 +146,6 @@ public function supportsForeignKeyConstraints()
146146 return false ;
147147 }
148148
149- /**
150- * {@inheritDoc}
151- */
152- public function supportsForeignKeyOnUpdate ()
153- {
154- return false ;
155- }
156-
157149 /**
158150 * {@inheritDoc}
159151 */
@@ -162,20 +154,12 @@ public function supportsViews()
162154 return false ;
163155 }
164156
165- /**
166- * {@inheritDoc}
167- */
168- public function prefersSequences ()
169- {
170- return false ;
171- }
172-
173157 /**
174158 * {@inheritDoc}
175159 */
176160 public function getListDatabasesSQL ()
177161 {
178- throw DBALException ::notSupported (__METHOD__ );
162+ throw Exception ::notSupported (__METHOD__ );
179163 }
180164
181165 /**
@@ -270,23 +254,23 @@ public function getAlterTableSQL(TableDiff $diff)
270254 }
271255
272256 if (count ($ diff ->removedColumns ) > 0 ) {
273- throw DBALException ::notSupported ("Alter Table: drop columns " );
257+ throw Exception ::notSupported ("Alter Table: drop columns " );
274258 }
275259 if (count ($ diff ->changedColumns ) > 0 ) {
276- throw DBALException ::notSupported ("Alter Table: change column options " );
260+ throw Exception ::notSupported ("Alter Table: change column options " );
277261 }
278262 if (count ($ diff ->renamedColumns ) > 0 ) {
279- throw DBALException ::notSupported ("Alter Table: rename columns " );
263+ throw Exception ::notSupported ("Alter Table: rename columns " );
280264 }
281265
282266 $ tableSql = array ();
283267
284268 if (!$ this ->onSchemaAlterTable ($ diff , $ tableSql )) {
285269 if ($ diff ->newName !== false ) {
286- throw DBALException ::notSupported ("Alter Table: rename table " );
270+ throw Exception ::notSupported ("Alter Table: rename table " );
287271 }
288272
289- $ sql = array_merge ($ sql , $ this ->_getAlterTableIndexForeignKeySQL ($ diff ), $ commentsSQL );
273+ $ sql = array_merge ($ sql , $ this ->getPreAlterTableIndexForeignKeySQL ( $ diff ), $ this -> getPostAlterTableIndexForeignKeySQL ($ diff ), $ commentsSQL );
290274 }
291275
292276 return array_merge ($ sql , $ tableSql , $ columnSql );
@@ -469,6 +453,7 @@ public function getName()
469453 */
470454 public function getSQLResultCasing ($ column )
471455 {
456+
472457 return strtolower ($ column );
473458 }
474459
@@ -509,15 +494,15 @@ public function getTimeFormatString()
509494 */
510495 public function getTruncateTableSQL ($ tableName , $ cascade = false )
511496 {
512- throw DBALException ::notSupported (__METHOD__ );
497+ throw Exception ::notSupported (__METHOD__ );
513498 }
514499
515500 /**
516501 * {@inheritDoc}
517502 */
518503 public function getReadLockSQL ()
519504 {
520- throw DBALException ::notSupported (__METHOD__ );
505+ throw Exception ::notSupported (__METHOD__ );
521506 }
522507
523508 /**
@@ -575,7 +560,7 @@ protected function getReservedKeywordsClass()
575560 */
576561 public function getBlobTypeDeclarationSQL (array $ field )
577562 {
578- throw DBALException ::notSupported (__METHOD__ );
563+ throw Exception ::notSupported (__METHOD__ );
579564 }
580565
581566 /**
@@ -596,7 +581,7 @@ public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDE
596581 }
597582
598583 if (count ($ table ->getColumns ()) === 0 ) {
599- throw DBALException ::noColumnsSpecifiedForTable ($ table ->getName ());
584+ throw Exception ::noColumnsSpecifiedForTable ($ table ->getName ());
600585 }
601586
602587 $ tableName = $ table ->getQuotedName ($ this );
@@ -615,7 +600,7 @@ public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDE
615600 }, $ index ->getColumns ());
616601 $ options ['primary_index ' ] = $ index ;
617602 } elseif ($ index ->isUnique ()) {
618- throw DBALException ::notSupported (
603+ throw Exception ::notSupported (
619604 "Unique constraints are not supported. Use `primary key` instead "
620605 );
621606 } else {
@@ -685,9 +670,9 @@ protected function _getCreateTableSQL($name, array $columns, array $options = ar
685670 $ columnListSql .= ', ' . $ this ->getIndexDeclarationSQL ($ index , $ definition );
686671 }
687672 }
688-
673+
689674 if (isset ($ options ['foreignKeys ' ])) {
690- throw DBALException ::notSupported ("Create Table: foreign keys " );
675+ throw Exception ::notSupported ("Create Table: foreign keys " );
691676 }
692677
693678 $ query = 'CREATE TABLE ' . $ name . ' ( ' . $ columnListSql . ') ' ;
@@ -774,15 +759,15 @@ private function buildPartitionOptions(array $options)
774759
775760 /**
776761 * @param \Doctrine\DBAL\Schema\Column $column The name of the table.
777- * @param array List of primary key column names
762+ * @param array $primaries List of primary key column names
778763 *
779764 * @return array The column data as associative array.
780- * @throws DBALException
765+ * @throws Exception
781766 */
782767 public static function prepareColumnData (AbstractPlatform $ platform , $ column , $ primaries = array ())
783768 {
784769 if ($ column ->hasCustomSchemaOption ("unique " ) ? $ column ->getCustomSchemaOption ("unique " ) : false ) {
785- throw DBALException ::notSupported ("Unique constraints are not supported. Use `primary key` instead " );
770+ throw Exception ::notSupported ("Unique constraints are not supported. Use `primary key` instead " );
786771 }
787772
788773 $ columnData = array ();
@@ -819,31 +804,31 @@ public static function prepareColumnData(AbstractPlatform $platform, $column, $p
819804 */
820805 public function getCreateDatabaseSQL ($ database )
821806 {
822- throw DBALException ::notSupported (__METHOD__ );
807+ throw Exception ::notSupported (__METHOD__ );
823808 }
824809
825810 /**
826811 * {@inheritDoc}
827812 */
828813 public function getDropDatabaseSQL ($ database )
829814 {
830- throw DBALException ::notSupported (__METHOD__ );
815+ throw Exception ::notSupported (__METHOD__ );
831816 }
832-
817+
833818 /**
834819 * {@inheritDoc}
835820 */
836821 public function getCreateForeignKeySQL (ForeignKeyConstraint $ foreignKey , $ table )
837822 {
838- throw DBALException ::notSupported (__METHOD__ );
823+ throw Exception ::notSupported (__METHOD__ );
839824 }
840-
825+
841826 /**
842827 * {@inheritDoc}
843828 */
844829 public function getGuidTypeDeclarationSQL (array $ field )
845830 {
846- throw DBALException ::notSupported (__METHOD__ );
831+ throw Exception ::notSupported (__METHOD__ );
847832 }
848833
849834 /**
0 commit comments