Describe the bug
Bootstrapping script 01_version_add_status_column.sql for SQL Server does not check schema name when deciding whether Version table has the Status column. If you have a database with multiple schemas and per-schema RoundhousE/Grate versioning, then the Status column will only be added once - for the first schema.
To Reproduce
Bootstrap an existing database that has multiple schemas and existing per-schema RoundhousE versioning. When bootstrapping Grate for all schemas, observe that the 01_version_add_status_column.sql is run for all schemas, but Status is actually only added to one schema.
Expected behavior
The Status column should be added to Version table for the "current" schema.
Screenshots
None.
Desktop (please complete the following information):
- Database: Microsoft SQL Server
- Version: 2.0.5
Additional context
The script should respect the schema name, e.g:
IF NOT EXISTS(
SELECT 1 FROM sys.columns WHERE name = 'status'
AND OBJECT_NAME(object_id) = '{{VersionTable}}'
AND OBJECT_SCHEMA_NAME(object_id) = '{{SchemaName}}')
BEGIN
ALTER TABLE {{SchemaName}}.{{VersionTable}}
ADD status nvarchar(50) NULL
END
Describe the bug
Bootstrapping script
01_version_add_status_column.sqlfor SQL Server does not check schema name when deciding whetherVersiontable has theStatuscolumn. If you have a database with multiple schemas and per-schema RoundhousE/Grate versioning, then theStatuscolumn will only be added once - for the first schema.To Reproduce
Bootstrap an existing database that has multiple schemas and existing per-schema RoundhousE versioning. When bootstrapping Grate for all schemas, observe that the
01_version_add_status_column.sqlis run for all schemas, butStatusis actually only added to one schema.Expected behavior
The
Statuscolumn should be added toVersiontable for the "current" schema.Screenshots
None.
Desktop (please complete the following information):
Additional context
The script should respect the schema name, e.g: