Files
autoAiWorkSys/_sql/check_account_config_table.sql
张成 4443d43ec1 1
2025-12-15 22:03:01 +08:00

49 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- Active: 1763990602551@@192.144.167.231@3306@autoaiworksys
-- ============================================
-- 检查 account_config 表的状态
-- ============================================
-- 1. 检查表是否存在
SELECT
TABLE_NAME,
TABLE_COMMENT,
ENGINE,
TABLE_ROWS,
CREATE_TIME,
UPDATE_TIME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'account_config';
-- 2. 查看表结构
DESCRIBE account_config;
-- 或者使用:
-- SHOW CREATE TABLE account_config;
-- 3. 查看表中的数据(应该是空的,因为这是配置表,需要手动创建记录)
SELECT * FROM account_config;
-- 4. 查看 pla_account 表中的账号,看看有哪些账号可以创建配置
SELECT
id,
sn_code,
name,
platform_type,
login_name,
is_enabled
FROM pla_account
WHERE is_delete = 0
ORDER BY id;
-- 5. 如果需要为所有账号创建默认配置,可以执行以下 SQL
-- INSERT INTO account_config (account_id, platform_type, notes)
-- SELECT
-- id AS account_id,
-- platform_type,
-- '默认配置' AS notes
-- FROM pla_account
-- WHERE is_delete = 0
-- AND id NOT IN (SELECT account_id FROM account_config);