Skip to content

Add schema changes for length for postgres #185

Merged
merged 1 commit into from Oct 6, 2012

5 participants

@mvrhov
mvrhov commented Aug 17, 2012

No description provided.

@travisbot

This pull request passes (merged f9015602 into 8f783fb).

@travisbot

This pull request passes (merged f9015602 into 8f783fb).

@guilhermeblanco guilhermeblanco commented on an outdated diff Aug 17, 2012
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
@@ -444,6 +444,11 @@ public function getAlterTableSQL(TableDiff $diff)
if ($columnDiff->hasChanged('comment') && $comment = $this->getColumnComment($column)) {
$commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment);
}
+ if ($columnDiff->hasChanged('length')) {
@guilhermeblanco
Doctrine member

Missing line break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@guilhermeblanco guilhermeblanco commented on an outdated diff Aug 17, 2012
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
@@ -444,6 +444,11 @@ public function getAlterTableSQL(TableDiff $diff)
if ($columnDiff->hasChanged('comment') && $comment = $this->getColumnComment($column)) {
$commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment);
}
+ if ($columnDiff->hasChanged('length')) {
+ // here was a server version check before, but DBAL API does not support this anymore.
@guilhermeblanco
Doctrine member

Comments should always start with upper cased letter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@guilhermeblanco guilhermeblanco commented on an outdated diff Aug 17, 2012
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
@@ -444,6 +444,11 @@ public function getAlterTableSQL(TableDiff $diff)
if ($columnDiff->hasChanged('comment') && $comment = $this->getColumnComment($column)) {
$commentsSQL[] = $this->getCommentOnColumnSQL($diff->name, $column->getName(), $comment);
}
+ if ($columnDiff->hasChanged('length')) {
+ // here was a server version check before, but DBAL API does not support this anymore.
+ $query = 'ALTER ' . $column->getName() . ' TYPE ' . $column->getType()->getSqlDeclaration($column->toArray(), $this);
+ $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query;
@guilhermeblanco
Doctrine member

Missing line break between the two logical blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mvrhov
mvrhov commented Aug 17, 2012

The comment is a remaining of copy/paste (I'll remove it). Regarding the other CS comments.. code uses same CS as the rest of the file. Do you still want me to fix it?

@mvrhov
mvrhov commented Aug 28, 2012

I've removed the column, but left the CS as is

@stof stof commented on an outdated diff Aug 28, 2012
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
@@ -619,6 +622,17 @@ public function getSmallIntTypeDeclarationSQL(array $field)
}
/**
+ * Decleration for a UUID field in PostgreSQL
+ *
+ * @param array $field
+ * @return string
+ */
+ public function getGuidTypeDeclartionSQL(array $field)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@beberlei
Doctrine member

@mvrhov pathfinder rule. leave the place better than it was before :-) No need to change everything though, but little steps. Can you also rebase to latest master? There is a conflict in the diff.

@guilhermeblanco guilhermeblanco commented on an outdated diff Aug 29, 2012
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
} else {
- $whereClause .= "$classAlias.relname = '" . $table . "'";
+ $schema = "ANY(string_to_array((select setting from pg_catalog.pg_settings where name = 'search_path'),','))";
@guilhermeblanco
Doctrine member

Use uppercased keywords.
select => SELECT, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mvrhov
mvrhov commented Aug 31, 2012

The problem with my previous commit was that I forgot to do a rebase.
This should be solved now....

@travisbot

This pull request passes (merged d0c00d3 into 24ec194).

@beberlei beberlei merged commit 443af38 into doctrine:master Oct 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.