if exists (select * from dbo.sysobjects where id = object_id(N'[QX_CONTEXTMENU]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [QX_CONTEXTMENU]
GO

create table dbo.QX_CONTEXTMENU (
  CONTEXTMENU_ID	VARCHAR(255)	NOT NULL,
  FORM_ID			VARCHAR(255)	NOT NULL,
constraint PK_QX_CONTETXMENU primary key (CONTEXTMENU_ID)
)
go

create index IDX_QX_CONTEXTMENU_FORM on dbo.QX_CONTEXTMENU (FORM_ID)
go


if exists (select * from dbo.sysobjects where id = object_id(N'[QX_MENUITEM]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [QX_MENUITEM]
GO

create table dbo.QX_MENUITEM (
  MENUITEM_ID		VARCHAR(255)	NOT NULL,
  CONTEXTMENU_ID	VARCHAR(255)	NOT NULL,
  MENUITEM_ORDER	INT,
constraint PK_QX_MENUITEM primary key (MENUITEM_ID)
)
go

create index IDX_QX_MENUITEM_CONTEXTMENU on dbo.QX_MENUITEM (CONTEXTMENU_ID)
create index IDX_QX_MENUITEM_ORDER on dbo.QX_MENUITEM (MENUITEM_ORDER)
go


insert into QX_CAP_TYPE values (8, 'Context Menu');
go

