﻿-- Migration fix
IF NOT EXISTS (
  SELECT d.name
  FROM sys.all_columns c
    INNER JOIN sys.tables t on t.object_id = c.object_id
    INNER JOIN sys.schemas s on s.schema_id = t.schema_id
    INNER JOIN sys.default_constraints d on c.default_object_id = d.object_id
  WHERE t.name = 'T_GONDVISELO'
    AND c.name = 'C_EGYEDIAZONOSITO'
    AND s.name = 'dbo'
)
BEGIN
  ALTER TABLE [dbo].[T_GONDVISELO]
    ADD DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [C_EGYEDIAZONOSITO];
END
GO
