ALTER TABLE dbo.QX_FOCUS DROP CONSTRAINT PK_QX_FOCUS
GO

TRUNCATE TABLE dbo.QX_FOCUS;
ALTER TABLE dbo.QX_FOCUS ADD PKEY INT NOT NULL DEFAULT 0;
go

ALTER TABLE dbo.QX_FOCUS ADD CONSTRAINT PK_QX_FOCUS PRIMARY KEY (PKEY)
go

UPDATE dbo.qx_role SET default_focus_id =NULL
ALTER TABLE dbo.QX_ROLE ADD CONSTRAINT FK_QX_ROLE_TO_FOCUS FOREIGN KEY (default_focus_id) REFERENCES qx_focus(pkey)
GO

ALTER TABLE dbo.QX_ROLE ADD DESCRIPTION VARCHAR(255) NULL;
GO
update qx_role set name='Administrator', description='This role can manage other users.' where role_id=0;
update qx_role set name='User', description='Regular user.' where role_id=1;
go

UPDATE QX_SYS_PROP SET PROP_VAL = '021' WHERE (PROP_ID = 'DB_CORE_VERSION');
go
