--
-- Tigase Workgroup Queues Component - Component for Tigase. Implementation of XEP-0142
-- Copyright (C) 2016 Tigase, Inc. (office@tigase.com) - All Rights Reserved
-- Unauthorized copying of this file, via any medium is strictly prohibited
-- Proprietary and confidential
--

-- QUERY START:
IF NOT exists(SELECT *
              FROM sysobjects
              WHERE name = 'tig_workgroup_queue' AND xtype = 'U')
  CREATE TABLE [dbo].[tig_workgroup_queue] (
    [jid]           NVARCHAR(2049) NOT NULL, /* Workgroup Queue JID */
    [description]   TEXT, /* A description of the queue. */
    [muc_domain]    NVARCHAR(2049), /* MUC Component domain name */
    [creation_date] DATETIME, /* The datetime when the node was created. */
    [creator_jid]   NVARCHAR(2049), /* Creator JID */
    [agents]        TEXT, /* Comma separated list of agents */
    PRIMARY KEY (jid)
  );
-- QUERY END:
GO

-- QUERY START:
exec TigSetComponentVersion 'workgroup', '1.0.0';
-- QUERY END:
GO
