Просмотр исходного кода

#2424 Auto-create Bot profile during installation

Alex Trofimov 6 лет назад
Родитель
Сommit
bfc39d61a3
1 измененных файлов с 19 добавлено и 0 удалено
  1. 19 0
      install/sql/addon.sql

+ 19 - 0
install/sql/addon.sql

@@ -1,4 +1,6 @@
 
+-- default admin account
+
 INSERT INTO `sys_accounts` (`name`, `email`, `email_confirmed`, `receive_updates`, `receive_news`, `password`, `salt`, `role`, `added`) VALUES 
 ({admin_username}, {admin_email}, 1, 1, 1, {admin_pwd_hash}, {admin_pwd_salt}, 3, {current_timestamp});
 
@@ -7,6 +9,22 @@ SET @iAccountId = LAST_INSERT_ID();
 INSERT INTO `sys_profiles` (`account_id`, `type`, `content_id`, `status`) VALUES
 (@iAccountId, 'system', @iAccountId, 'active');
 
+
+-- default bot profile
+
+INSERT INTO `sys_accounts` (`name`, `email`, `email_confirmed`, `receive_updates`, `receive_news`, `password`, `salt`, `role`, `added`) VALUES 
+('Robot', '', 0, 0, 0, '', '', 1, {current_timestamp});
+
+SET @iAccountIdBot = LAST_INSERT_ID();
+
+INSERT INTO `sys_profiles` (`account_id`, `type`, `content_id`, `status`) VALUES
+(@iAccountIdBot, 'system', @iAccountIdBot, 'active');
+
+SET @iProfileIdBot = LAST_INSERT_ID();
+
+
+-- site settings
+
 UPDATE `sys_options` SET `VALUE` = {admin_email} WHERE `Name` = 'site_email';
 UPDATE `sys_options` SET `VALUE` = {site_title} WHERE `Name` = 'site_title';
 UPDATE `sys_options` SET `VALUE` = {site_email} WHERE `Name` = 'site_email_notify';
@@ -14,5 +32,6 @@ UPDATE `sys_options` SET `VALUE` = {language} WHERE `Name` = 'lang_default';
 UPDATE `sys_options` SET `VALUE` = {time} WHERE `Name` = 'sys_install_time';
 UPDATE `sys_options` SET `VALUE` = {oauth_key} WHERE `Name` = 'sys_oauth_key';
 UPDATE `sys_options` SET `VALUE` = {oauth_secret} WHERE `Name` = 'sys_oauth_secret';
+UPDATE `sys_options` SET `VALUE` = @iProfileIdBot WHERE `Name` = 'sys_profile_bot';
 
 UPDATE `sys_modules` SET `version` = {version} WHERE `name` = 'system';