pangu-user-platform/backend/sql/school_dept_permission.sql

17 lines
648 B
SQL
Raw Permalink 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.

-- ============================================================
-- 脚本名称school_dept_permission.sql
-- 功能说明:学校数据权限支持 - 增加部门关联字段
-- 作 者pangu
-- 创建时间2026-02-03
-- ============================================================
-- 1. pg_school 表增加 dept_id 字段
ALTER TABLE pg_school ADD COLUMN dept_id BIGINT COMMENT '关联部门ID';
CREATE INDEX idx_school_dept ON pg_school(dept_id);
-- 2. 查看现有学校数据
SELECT school_id, school_name, school_code FROM pg_school;
-- 3. 查看现有部门数据
SELECT dept_id, parent_id, dept_name, ancestors FROM sys_dept;