--sequence
select ORDER_NOTIFICATION_SEQ.nextVal from dual;
create sequence ORDER_NOTIFICATION_SEQ start 1 increment by 1
minvalue 1 maxvalue 999999999999 cache 20 noorder;
drop sequence ORDER_NOTIFICATION_SEQ;
-- index
create (unique) index patient_indx on
NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION(PATIENT_ID);
drop index patient_indx;
---primary key
--add
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION add
constraint OR_NTF_PK primary key (ORDER_NOTIFICATION_ID);
--drop
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION drop
primary key;
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION drop
constraint OR_NTF_PK;
--unique
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION add
constraint PATIENT_ID_UK unique (PATIENT_ID);
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION drop
constraint PATIENT_ID_UK -- 知道命名
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION drop
unique(PATIENT_ID)--
不知道命名
-- grant role
GRANT SELECT, INSERT, UPDATE, ALTER, DELETE ON
NH_${ENV}_${REG}C_COMMERCIAL.NOTIFICATION_TYPE TO
nh_${ENV}_${REG}_SuperUser_sg;
--foreign key
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION add
constraint ORDER_NOTIFICATION_ID_FK foreign key
(ORDER_NOTIFICATION_ID) references
NH_DV4_2C_COMMERCIAL.SALES_ORDER(ORDER_NUM);
--drop
alter table NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION drop
constraint ORDER_NOTIFICATION_ID_FK;
-- add column
ALTER TABLE NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION ADD
("NOTIFICATION_SENT_DATE" date);
-- modify column
ALTER TABLE NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION modify
(PATIENT_ID not NULL);
-- rename column
ALTER TABLE NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION RENAME
COLUMN NOTIFICATION_SENT_DATE TO NOTIFICATION_SENT_DATE1;
--- drop column
ALTER TABLE NH_DV4_2C_COMMERCIAL.ORDER_NOTIFICATION DROP
COLUMN NOTIFICATION_SENT_DATE;