23
23
24
24
use Crate \DBAL \Types \MapType ;
25
25
use Crate \DBAL \Types \TimestampType ;
26
- use Doctrine \DBAL \DBALException ;
26
+ use Doctrine \DBAL \Exception ;
27
27
use Doctrine \DBAL \Event \SchemaCreateTableColumnEventArgs ;
28
28
use Doctrine \DBAL \Event \SchemaCreateTableEventArgs ;
29
29
use Doctrine \DBAL \Events ;
@@ -76,7 +76,7 @@ public function getSubstringExpression($value, $from = 0, $length = null)
76
76
*/
77
77
public function getNowExpression ()
78
78
{
79
- throw DBALException ::notSupported (__METHOD__ );
79
+ throw Exception ::notSupported (__METHOD__ );
80
80
}
81
81
82
82
/**
@@ -92,7 +92,7 @@ public function getRegexpExpression()
92
92
*/
93
93
public function getDateDiffExpression ($ date1 , $ date2 )
94
94
{
95
- throw DBALException ::notSupported (__METHOD__ );
95
+ throw Exception ::notSupported (__METHOD__ );
96
96
}
97
97
98
98
/**
@@ -146,14 +146,6 @@ public function supportsForeignKeyConstraints()
146
146
return false ;
147
147
}
148
148
149
- /**
150
- * {@inheritDoc}
151
- */
152
- public function supportsForeignKeyOnUpdate ()
153
- {
154
- return false ;
155
- }
156
-
157
149
/**
158
150
* {@inheritDoc}
159
151
*/
@@ -162,20 +154,12 @@ public function supportsViews()
162
154
return false ;
163
155
}
164
156
165
- /**
166
- * {@inheritDoc}
167
- */
168
- public function prefersSequences ()
169
- {
170
- return false ;
171
- }
172
-
173
157
/**
174
158
* {@inheritDoc}
175
159
*/
176
160
public function getListDatabasesSQL ()
177
161
{
178
- throw DBALException ::notSupported (__METHOD__ );
162
+ throw Exception ::notSupported (__METHOD__ );
179
163
}
180
164
181
165
/**
@@ -270,23 +254,23 @@ public function getAlterTableSQL(TableDiff $diff)
270
254
}
271
255
272
256
if (count ($ diff ->removedColumns ) > 0 ) {
273
- throw DBALException ::notSupported ("Alter Table: drop columns " );
257
+ throw Exception ::notSupported ("Alter Table: drop columns " );
274
258
}
275
259
if (count ($ diff ->changedColumns ) > 0 ) {
276
- throw DBALException ::notSupported ("Alter Table: change column options " );
260
+ throw Exception ::notSupported ("Alter Table: change column options " );
277
261
}
278
262
if (count ($ diff ->renamedColumns ) > 0 ) {
279
- throw DBALException ::notSupported ("Alter Table: rename columns " );
263
+ throw Exception ::notSupported ("Alter Table: rename columns " );
280
264
}
281
265
282
266
$ tableSql = array ();
283
267
284
268
if (!$ this ->onSchemaAlterTable ($ diff , $ tableSql )) {
285
269
if ($ diff ->newName !== false ) {
286
- throw DBALException ::notSupported ("Alter Table: rename table " );
270
+ throw Exception ::notSupported ("Alter Table: rename table " );
287
271
}
288
272
289
- $ sql = array_merge ($ sql , $ this ->_getAlterTableIndexForeignKeySQL ($ diff ), $ commentsSQL );
273
+ $ sql = array_merge ($ sql , $ this ->getPreAlterTableIndexForeignKeySQL ( $ diff ), $ this -> getPostAlterTableIndexForeignKeySQL ($ diff ), $ commentsSQL );
290
274
}
291
275
292
276
return array_merge ($ sql , $ tableSql , $ columnSql );
@@ -469,6 +453,7 @@ public function getName()
469
453
*/
470
454
public function getSQLResultCasing ($ column )
471
455
{
456
+
472
457
return strtolower ($ column );
473
458
}
474
459
@@ -509,15 +494,15 @@ public function getTimeFormatString()
509
494
*/
510
495
public function getTruncateTableSQL ($ tableName , $ cascade = false )
511
496
{
512
- throw DBALException ::notSupported (__METHOD__ );
497
+ throw Exception ::notSupported (__METHOD__ );
513
498
}
514
499
515
500
/**
516
501
* {@inheritDoc}
517
502
*/
518
503
public function getReadLockSQL ()
519
504
{
520
- throw DBALException ::notSupported (__METHOD__ );
505
+ throw Exception ::notSupported (__METHOD__ );
521
506
}
522
507
523
508
/**
@@ -575,7 +560,7 @@ protected function getReservedKeywordsClass()
575
560
*/
576
561
public function getBlobTypeDeclarationSQL (array $ field )
577
562
{
578
- throw DBALException ::notSupported (__METHOD__ );
563
+ throw Exception ::notSupported (__METHOD__ );
579
564
}
580
565
581
566
/**
@@ -596,7 +581,7 @@ public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDE
596
581
}
597
582
598
583
if (count ($ table ->getColumns ()) === 0 ) {
599
- throw DBALException ::noColumnsSpecifiedForTable ($ table ->getName ());
584
+ throw Exception ::noColumnsSpecifiedForTable ($ table ->getName ());
600
585
}
601
586
602
587
$ tableName = $ table ->getQuotedName ($ this );
@@ -615,7 +600,7 @@ public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDE
615
600
}, $ index ->getColumns ());
616
601
$ options ['primary_index ' ] = $ index ;
617
602
} elseif ($ index ->isUnique ()) {
618
- throw DBALException ::notSupported (
603
+ throw Exception ::notSupported (
619
604
"Unique constraints are not supported. Use `primary key` instead "
620
605
);
621
606
} else {
@@ -685,9 +670,9 @@ protected function _getCreateTableSQL($name, array $columns, array $options = ar
685
670
$ columnListSql .= ', ' . $ this ->getIndexDeclarationSQL ($ index , $ definition );
686
671
}
687
672
}
688
-
673
+
689
674
if (isset ($ options ['foreignKeys ' ])) {
690
- throw DBALException ::notSupported ("Create Table: foreign keys " );
675
+ throw Exception ::notSupported ("Create Table: foreign keys " );
691
676
}
692
677
693
678
$ query = 'CREATE TABLE ' . $ name . ' ( ' . $ columnListSql . ') ' ;
@@ -774,15 +759,15 @@ private function buildPartitionOptions(array $options)
774
759
775
760
/**
776
761
* @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
778
763
*
779
764
* @return array The column data as associative array.
780
- * @throws DBALException
765
+ * @throws Exception
781
766
*/
782
767
public static function prepareColumnData (AbstractPlatform $ platform , $ column , $ primaries = array ())
783
768
{
784
769
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 " );
786
771
}
787
772
788
773
$ columnData = array ();
@@ -819,31 +804,31 @@ public static function prepareColumnData(AbstractPlatform $platform, $column, $p
819
804
*/
820
805
public function getCreateDatabaseSQL ($ database )
821
806
{
822
- throw DBALException ::notSupported (__METHOD__ );
807
+ throw Exception ::notSupported (__METHOD__ );
823
808
}
824
809
825
810
/**
826
811
* {@inheritDoc}
827
812
*/
828
813
public function getDropDatabaseSQL ($ database )
829
814
{
830
- throw DBALException ::notSupported (__METHOD__ );
815
+ throw Exception ::notSupported (__METHOD__ );
831
816
}
832
-
817
+
833
818
/**
834
819
* {@inheritDoc}
835
820
*/
836
821
public function getCreateForeignKeySQL (ForeignKeyConstraint $ foreignKey , $ table )
837
822
{
838
- throw DBALException ::notSupported (__METHOD__ );
823
+ throw Exception ::notSupported (__METHOD__ );
839
824
}
840
-
825
+
841
826
/**
842
827
* {@inheritDoc}
843
828
*/
844
829
public function getGuidTypeDeclarationSQL (array $ field )
845
830
{
846
- throw DBALException ::notSupported (__METHOD__ );
831
+ throw Exception ::notSupported (__METHOD__ );
847
832
}
848
833
849
834
/**
0 commit comments