prefix.DB::$namespace.'_api_keys_bot'; } public function __construct() { parent::__construct(); $this->table_name = $this->prefix.'_api_keys_bot'; $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, uuid varchar(36) NOT NULL, restaurant_id bigint(20) NOT NULL, widget_id bigint(20) NOT NULL, api_key varchar(64) NOT NULL, platform varchar(50) DEFAULT NULL, name varchar(100) DEFAULT NULL, is_active tinyint DEFAULT 1, last_used_at datetime DEFAULT NULL, date_created datetime NOT NULL, date_modified datetime NOT NULL, PRIMARY KEY (id), UNIQUE KEY api_key (api_key), KEY `api_keys_bot_restaurant_id_foreign` (`restaurant_id`), KEY `api_keys_bot_widget_id` (`widget_id`), CONSTRAINT `api_keys_bot_restaurant_id_foreign` FOREIGN KEY (`restaurant_id`) REFERENCES `{$this->prefix}_restaurants` (`id`) ON DELETE CASCADE )"; } } SRR_DB_Api_Keys_Bot::init();