-- Copyright (c) 1997-now, NeoNova BV, The Netherlands. All rights Reserved.
--
-- This software is the copyrighted work of NeoNova BV.
-- Use of the software is subject to the general business terms and conditions of NeoNova BV
-- and its related transaction documents like license sheets or other written notices.#
-- Any reproduction or redistribution of the software not in accordance with the license terms
-- is expressly prohibited by law, and may result in severe civil and criminally penalties.
-- Violators will be prosecuted to the maximum extent possible.

BEGIN;

CREATE TABLE messaging_translate (
 id serial,

 created timestamp with time zone not null default CURRENT_TIMESTAMP,
--HELP_EN_INFO:Creation Date
--HELP_EN_LONG:The date and time this record was created.
--HELP_NL_INFO:Datum aanmaak
--HELP_NL_LONG:De tijd en datum waarop dit is aangemaakt.

 lastupdate timestamp with time zone not null default CURRENT_TIMESTAMP,
--HELP_EN_INFO:Last Update
--HELP_EN_LONG:The date and time this record was updated.
--HELP_NL_INFO:Laatste wijziging
--HELP_NL_LONG:De tijd en datum van laatste wijziging.

 messaging integer default '1',
--HELP_EN_INFO:messaging service
--HELP_EN_LONG:The messaging service this record belongs to.
--HELP_NL_INFO:messaging service
--HELP_NL_LONG:De messaging service waar deze gegenves bij horen.

 message varchar(24) default '',
--HELP_EN_INFO:text
--HELP_EN_LONG:The text to be translated
--HELP_NL_INFO:Tekst
--HELP_NL_LONG:De tekst die moet worden vertaald

 ignore varchar(3) NOT NULL default 'no'
   CHECK (ignore IN ('yes','no')),
--HELP_EN_INFO:ignore
--HELP_EN_LONG:Should this message be ignored?
--HELP_NL_INFO:negeren
--HELP_NL_LONG:Zet op Ja als deze tekst genegeerd moet worden

 replacement varchar(255) default '',
--HELP_EN_INFO:replacement
--HELP_EN_LONG:The replacement text
--HELP_NL_INFO:Vervanging
--HELP_NL_LONG:De vervangende tekst

 cidnum varchar(15) default '',
--HELP_EN_INFO:phonenumber
--HELP_EN_LONG:The callerid phonenumber to be used for this message.
--HELP_NL_INFO:telefoonnummer
--HELP_NL_LONG:Het telefoonnummer wat moet worden meegezonden als afzendernummer.

 target varchar(24) default '',
--HELP_EN_INFO:target
--HELP_EN_LONG:The target this message should be directed to.
--HELP_NL_INFO:doel
--HELP_NL_LONG:Het doel waarnaar deze tekst verstuurd moet worden.

 PRIMARY KEY  (id)
);

GRANT UPDATE, SELECT, INSERT, DELETE ON messaging_translate TO astium;
GRANT UPDATE, SELECT, INSERT, DELETE ON messaging_translate_id_seq TO astium;

ALTER TABLE messaging_translate ADD CONSTRAINT messaging_translate_messaging_constraint FOREIGN KEY (messaging) REFERENCES messaging (id);

COMMIT;

