Skip to content

Conversation

@vmarko-sowalabs
Copy link
Contributor

Fixes sql errors due to using a reserved word (e.g. user, group) as a table name.

foreach (var table in tablesToTurnOnSystemVersioning)
{
builder.Append($"alter table {table.Schema}.{table.Name} set (SYSTEM_VERSIONING = ON (HISTORY_TABLE = {table.HistoryTableSchema}.{table.HistoryTableName}));\r\n");
builder.Append($"alter table \"{table.Schema}\".\"{table.Name}\" set (SYSTEM_VERSIONING = ON (HISTORY_TABLE = {table.HistoryTableSchema}.{table.HistoryTableName}));\r\n");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the QuoteCharacter constant here to make this a bit more consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Fixes sql errors due to using a reserved word (e.g. user, group) as a table name.
@jbogard jbogard merged commit f29dfc0 into jbogard:master Oct 18, 2021
@jbogard jbogard added this to the v5.0.0 milestone Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants