| -- |
| -- Licensed to the Apache Software Foundation (ASF) under one |
| -- or more contributor license agreements. See the NOTICE file |
| -- distributed with this work for additional information |
| -- regarding copyright ownership. The ASF licenses this file |
| -- to you under the Apache License, Version 2.0 (the |
| -- "License"); you may not use this file except in compliance |
| -- with the License. You may obtain a copy of the License at |
| -- |
| -- http://www.apache.org/licenses/LICENSE-2.0 |
| -- |
| -- Unless required by applicable law or agreed to in writing, |
| -- software distributed under the License is distributed on an |
| -- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| -- KIND, either express or implied. See the License for the |
| -- specific language governing permissions and limitations |
| -- under the License. |
| -- |
| |
| DROP TABLE IF EXISTS `sms_messages_outbound`; |
| CREATE TABLE `sms_messages_outbound` ( |
| `id` BIGINT NOT NULL AUTO_INCREMENT, |
| `group_id` BIGINT DEFAULT NULL, |
| `client_id` BIGINT DEFAULT NULL, |
| `staff_id` BIGINT DEFAULT NULL, |
| `status_enum` INT NOT NULL DEFAULT '100', |
| `mobile_no` varchar(50) NOT NULL, |
| `message` varchar(1000) NOT NULL, |
| PRIMARY KEY (`id`), |
| KEY `FKGROUP000000001` (`group_id`), |
| KEY `FKCLIENT00000001` (`client_id`), |
| CONSTRAINT `FKGROUP000000001` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), |
| CONSTRAINT `FKCLIENT00000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), |
| CONSTRAINT `FKSTAFF000000001` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`) |
| ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; |
| |
| -- Permissions for CRUD on SMS outbound message tracking |
| DELETE FROM `m_permission` WHERE `entity_name`='SMS'; |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'READ_SMS', 'SMS', 'READ', 0); |
| |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'CREATE_SMS', 'SMS', 'CREATE', 0); |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'CREATE_SMS_CHECKER', 'SMS', 'CREATE', 0); |
| |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'UPDATE_SMS', 'SMS', 'UPDATE', 0); |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'UPDATE_SMS_CHECKER', 'SMS', 'UPDATE', 0); |
| |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'DELETE_SMS', 'SMS', 'DELETE', 0); |
| INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) |
| VALUES ('organisation', 'DELETE_SMS_CHECKER', 'SMS', 'DELETE', 0); |