DBAL-678: [GH-426] [DBAL-569] Add support for column comments / commented types in SQL Server #1899

Closed
doctrinebot opened this Issue Nov 24, 2013 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of deeky666:

Url: #426

Message:

SQL Server has no native support for column comments. Therefore commented types are currently not supported for SQL Server leading to repeated ALTER TABLE statements by schema tool when using types that require column comments.
However there is a way to store column comments. Using SQL Server's extended properties functionality, it is possible to store metadata for columns. This is also the way SQL Server Management Studio stores "Description" property for columns.
This PR implements this to be able to use comments for columns and enable support for commented types.

The PR is not 100% finished, yet as we need to find a way to generate the correct statements in the following table alteration scenarios:

  • Renamed column that also requires a comment change (either due to changed comment or change from or to a commented type that required/requires a column comment change.
  • Changed column where $columnDiff->fromColumn is not set.

Using extended properties we need to know whether a column comment has to be added, updated or removed in order to generate the appropriate SQL statement. This is due to SQL Server having a different stored procedure for each operation. Using the wrong stored procedure leads to an error.
Therefore we always need to know the type and comment information from the column to change from in a table alteration scenario. Unfortunately we don't have that if a column is marked as renamed in the table diff or if it is marked as changed but no $columnDiff->fromColumn is set (this is the case in some tests actually).

Awaiting feedback how to proceed in thos scenarios.

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-426] was closed:
#426

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@beberlei beberlei was assigned by doctrinebot Dec 7, 2015
@doctrinebot doctrinebot added this to the 2.5 milestone Dec 7, 2015
@doctrinebot doctrinebot closed this Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment