Permalink
Browse files

Fixed CS in SqlitePlatform

  • Loading branch information...
1 parent 2a057e9 commit d679eb96ec34570c46967fe7089e3a96dbdcd3b7 @hason hason committed Nov 21, 2012
Showing with 23 additions and 11 deletions.
  1. +23 −11 lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
@@ -327,13 +327,19 @@ public function getClobTypeDeclarationSQL(array $field)
return 'CLOB';
}
+ /**
+ * {@inheritDoc}
+ */
public function getListTableConstraintsSQL($table)
{
$table = str_replace('.', '__', $table);
return "SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = '$table' AND sql NOT NULL ORDER BY name";
}
+ /**
+ * {@inheritDoc}
+ */
public function getListTableColumnsSQL($table, $currentDatabase = null)
{
$table = str_replace('.', '__', $table);
@@ -351,6 +357,9 @@ public function getListTableIndexesSQL($table, $currentDatabase = null)
return "PRAGMA index_list($table)";
}
+ /**
+ * {@inheritDoc}
+ */
public function getListTablesSQL()
{
return "SELECT name FROM sqlite_master WHERE type = 'table' AND name != 'sqlite_sequence' AND name != 'geometry_columns' AND name != 'spatial_ref_sys' "
@@ -366,11 +375,17 @@ public function getListViewsSQL($database)
return "SELECT name, sql FROM sqlite_master WHERE type='view' AND sql NOT NULL";
}
+ /**
+ * {@inheritDoc}
+ */
public function getCreateViewSQL($name, $sql)
{
return 'CREATE VIEW ' . $name . ' AS ' . $sql;
}
+ /**
+ * {@inheritDoc}
+ */
public function getDropViewSQL($name)
{
return 'DROP VIEW '. $name;
@@ -383,21 +398,15 @@ public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey
{
$query = parent::getAdvancedForeignKeyOptionsSQL($foreignKey);
- if ($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false) {
- $query .= ' DEFERRABLE';
- } else {
- $query .= ' NOT DEFERRABLE';
- }
-
- if ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) {
- $query .= ' INITIALLY DEFERRED';
- } else {
- $query .= ' INITIALLY IMMEDIATE';
- }
+ $query .= (($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false) ? ' ' : ' NOT ') . 'DEFERRABLE';
+ $query .= ' INITIALLY ' . (($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) ? 'DEFERRED' : 'IMMEDIATE');
return $query;
}
+ /**
+ * {@inheritDoc}
+ */
public function supportsIdentityColumns()
{
return true;
@@ -463,6 +472,9 @@ static public function udfLocate($str, $substr, $offset = 0)
return 0;
}
+ /**
+ * {@inheritDoc}
+ */
public function getForUpdateSql()
{
return '';

0 comments on commit d679eb9

Please sign in to comment.