I'm running db-patch with WolverineFx 6.35 and Weasel.SqlServer 9.30. The generated SQL needs to have GO before the CREATE OR ALTER PROCEDURE statement. I have indicated that location in the generated script below. I'll also add that it would be nice if these scripts were idempotent.
IF NOT EXISTS ( SELECT *
FROM sys.schemas
WHERE name = N'wolverine' )
EXEC('CREATE SCHEMA [wolverine]');
CREATE INDEX idx_wolverine_outgoing_envelopes_recover ON wolverine.wolverine_outgoing_envelopes (destination) WHERE ([owner_id]=0);
CREATE INDEX idx_wolverine_incoming_envelopes_recover ON wolverine.wolverine_incoming_envelopes (received_at) WHERE ([status]='Incoming' AND [owner_id]=0);
CREATE INDEX idx_wolverine_incoming_envelopes_keep_until ON wolverine.wolverine_incoming_envelopes (keep_until) WHERE ([status]='Handled');
CREATE INDEX idx_wolverine_incoming_envelopes_scheduled ON wolverine.wolverine_incoming_envelopes
(execution_time) WHERE ([status]='Scheduled');
-- NEEDS A GO STATEMENT HERE
CREATE OR ALTER PROCEDURE wolverine.uspMarkIncomingOwnership
@IDLIST wolverine.EnvelopeIdList READONLY,
@owner INT
AS
-- GH-4216: without the status predicate this also rewrites rows that are already Incoming or Handled.
-- The load side of the poll selects only Scheduled rows, so constraining the update to match costs nothing
-- and keeps the promotion from touching a row it never selected.
UPDATE wolverine.wolverine_incoming_envelopes
SET owner_id = @owner, status = 'Incoming'
WHERE status = 'Scheduled' AND id IN (SELECT ID FROM @IDLIST);
alter table wolverine.wolverine_nodes alter column version varchar(500) NULL;
alter table wolverine.wolverine_control_queue alter column message_type varchar(500) NOT NULL;
alter table wolverine.wolverine_agent_restrictions alter column uri varchar(500) NOT NULL;
alter table wolverine.wolverine_agent_restrictions alter column type varchar(500) NOT NULL;
alter table wolverine.wolverine_node_records alter column description varchar(1000) NULL;
I'm running db-patch with WolverineFx 6.35 and Weasel.SqlServer 9.30. The generated SQL needs to have GO before the CREATE OR ALTER PROCEDURE statement. I have indicated that location in the generated script below. I'll also add that it would be nice if these scripts were idempotent.