prefix.DB::$namespace.'_missed_call_logs'; } public function __construct() { parent::__construct(); $this->table_name = $this->prefix.'_missed_call_logs'; $this->primary_key = 'id'; $this->version = '1.0'; } public function sql_create() { return "CREATE TABLE {$this->table_name} ( id bigint(20) NOT NULL AUTO_INCREMENT, restaurant_id bigint(20) NOT NULL, caller_phone varchar(30) NOT NULL, destination_phone varchar(30) NOT NULL, call_id varchar(100) DEFAULT NULL, pbx_provider varchar(50) DEFAULT NULL, sms_sent tinyint(1) DEFAULT 0, whatsapp_sent tinyint(1) DEFAULT 0, sms_short_code varchar(10) DEFAULT NULL, whatsapp_short_code varchar(10) DEFAULT NULL, booking_id bigint(20) DEFAULT NULL, payload longtext DEFAULT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, PRIMARY KEY (id), KEY `missed_call_logs_restaurant_id_index` (`restaurant_id`), KEY `missed_call_logs_caller_phone_index` (`caller_phone`), KEY `missed_call_logs_sms_short_code_index` (`sms_short_code`), KEY `missed_call_logs_whatsapp_short_code_index` (`whatsapp_short_code`), CONSTRAINT `missed_call_logs_restaurant_id_foreign` FOREIGN KEY (`restaurant_id`) REFERENCES `{$this->prefix}_restaurants` (`id`) ON DELETE CASCADE )"; } } SRR_DB_Missed_Call_Logs::init();