TG.WXCRM.V4/Model/Sql/2022-7-18.txt

111 lines
3.8 KiB
Plaintext
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.

alter table BAS_SALESDEPARTMENT modify saledeptcode VARCHAR2(50);
-- Add/modify columns
alter table BAS_INNERUSER add employee_id NUMBER;
-- Add comments to the columns
comment on column BAS_INNERUSER.employee_id
is '员工系统员工的ID';
-- Add/modify columns
alter table BAS_INNERGROUP add department_id NUMBER;
alter table BAS_INNERGROUP add department_code VARCHAR2(50);
alter table BAS_INNERGROUP add is_profession NUMBER;
alter table BAS_INNERGROUP add department_parentid NUMBER;
alter table BAS_INNERGROUP add ischeck NUMBER;
alter table BAS_INNERGROUP add department_sort NUMBER;
alter table BAS_INNERGROUP add is_deleted NUMBER;
-- Add comments to the columns
comment on column BAS_INNERGROUP.department_id
is '员工系统:对应部门Id';
comment on column BAS_INNERGROUP.department_code
is '员工系统:对应部门编码';
comment on column BAS_INNERGROUP.is_profession
is '员工系统:是否为业务部门 1 为业务部门 0为其他部门';
comment on column BAS_INNERGROUP.department_parentid
is '员工系统:对应部门的父Id';
comment on column BAS_INNERGROUP.ischeck
is '员工系统:是否勾选 1是 0否';
comment on column BAS_INNERGROUP.department_sort
is '员工系统:排序';
comment on column BAS_INNERGROUP.is_deleted
is '员工系统:是否删除';
-- Add/modify columns
alter table BAS_SALESDEPARTMENT add department_id NUMBER;
alter table BAS_SALESDEPARTMENT add department_code VARCHAR2(50);
alter table BAS_SALESDEPARTMENT add is_profession NUMBER;
alter table BAS_SALESDEPARTMENT add department_parentid NUMBER;
alter table BAS_SALESDEPARTMENT add ischeck NUMBER;
alter table BAS_SALESDEPARTMENT add department_sort NUMBER;
alter table BAS_SALESDEPARTMENT add is_deleted NUMBER;
-- Add comments to the columns
comment on column BAS_SALESDEPARTMENT.department_id
is '员工系统对应的部门ID';
comment on column BAS_SALESDEPARTMENT.department_code
is '员工系统:对应的部门编码';
comment on column BAS_SALESDEPARTMENT.is_profession
is '员工系统:是否为业务部门, 1为业务部门0为其他部门';
comment on column BAS_SALESDEPARTMENT.department_parentid
is '员工系统部门的父ID';
comment on column BAS_SALESDEPARTMENT.ischeck
is '员工系统是否勾选1是 0否';
comment on column BAS_SALESDEPARTMENT.department_sort
is '员工系统:排序';
comment on column BAS_SALESDEPARTMENT.is_deleted
is '员工系统:是否删除';
-- Create table
create table BAS_EMPLOYEE_DEPARTMENT
(
id NUMBER,
employee_id NUMBER,
department_id NUMBER,
is_deleted NUMBER,
create_time DATE,
update_time DATE
)
tablespace UPDEV_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Add comments to the table
comment on table BAS_EMPLOYEE_DEPARTMENT
is '员工部门关系表:员工系统同步过来的';
-- Add comments to the columns
comment on column BAS_EMPLOYEE_DEPARTMENT.id
is '主键ID';
comment on column BAS_EMPLOYEE_DEPARTMENT.employee_id
is '用户ID';
comment on column BAS_EMPLOYEE_DEPARTMENT.department_id
is '部门ID';
comment on column BAS_EMPLOYEE_DEPARTMENT.is_deleted
is '删除标志';
comment on column BAS_EMPLOYEE_DEPARTMENT.create_time
is '创建时间';
comment on column BAS_EMPLOYEE_DEPARTMENT.update_time
is '更新时间';
alter table BAS_GROUPLEADER add type NUMBER;
comment on column BAS_GROUPLEADER.type
is '类型 0销售组 1部门';
--Oracle需要调整的地方
--删除外键关系
alter table BAS_INNERGROUP
drop constraint FK_BAS_INNERDEPARTMENT;
-- Drop primary, unique and foreign key constraints
alter table BAS_SALESDEPARTMENT
drop constraint FK_BAS_SALE_REFERENCE_BAS_COMP;
-- Drop primary, unique and foreign key constraints
alter table BAS_INNERGROUP
drop constraint FK_BAS_INNE_REFERENCE_BAS_SALE;