首页 > 数据库 > Oracle > 约束 comment 创建语句
-- Add/modify columns alter table ASCR_RACE add belong_id varchar2(32); alter table ASCR_RACE add belong_type varchar2(32); -- Add comments to the columns comment on column ASCR_RACE.belong_id is '归属id'; comment on column ASCR_RACE.belong_type is '归属类型'; -- Add/modify columns alter table ASCR_THIRD_ORDER add third_mch_id varchar2(32); -- Add comments to the columns comment on column ASCR_THIRD_ORDER.third_mch_id is '第三方商户id(这里直接记录商户号,因为有可能会有换商户号的情况存在,只记录平台会导致订单无法找到)'; -- Add/modify columns alter table AISPORTCORE.ASCR_ACTIVITY_TRADE add trade_finish_platform VARCHAR2(32); -- Add comments to the columns comment on column AISPORTCORE.ASCR_ACTIVITY_TRADE.trade_finish_platform is '交易完成平台'; -- Add/modify columns alter table AISPORTCORE.ASCR_USER_DEFIND_LABEL modify label null; -- Create table create table ASCR_CLUB_MEMBER_ACT_STATIS ( id VARCHAR2(32) not null, club_memeber_id VARCHAR2(32) not null, max_single_s_v_count NUMBER(5) not null, current_single_s_v_count NUMBER(5) not null, max_double_s_v_count NUMBER(5) not null, current_double_s_v_count NUMBER(5) not null, max_all_s_v_count NUMBER(5) not null, current_all_s_v_count NUMBER(5) not null, gmt_create TIMESTAMP(6) not null, gmt_modified TIMESTAMP(6) not null, club_id VARCHAR2(32), gmt_single_data_generate TIMESTAMP(6), gmt_double_data_generate TIMESTAMP(6), gmt_all_data_generate TIMESTAMP(6) ) tablespace AISPORTCORE pctfree 10 initrans 1 maxtrans 255; -- Add comments to the table comment on table ASCR_CLUB_MEMBER_ACT_STATIS is '俱乐部成员活动统计'; -- Add comments to the columns comment on column ASCR_CLUB_MEMBER_ACT_STATIS.id is '主键id'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.club_memeber_id is '俱乐部成员id'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.max_single_s_v_count is '最大单打连胜数'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.current_single_s_v_count is '当前单打连胜数'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.max_double_s_v_count is '最大双打连胜数'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.current_double_s_v_count is '当前双打连胜数'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.max_all_s_v_count is '最大所有比赛连胜数'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.current_all_s_v_count is '当前所有比赛连胜数'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.gmt_create is '创建时间'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.gmt_modified is '修改时间'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.club_id is '俱乐部id'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.gmt_single_data_generate is '单打数据产生时间'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.gmt_double_data_generate is '双打数据产生时间'; comment on column ASCR_CLUB_MEMBER_ACT_STATIS.gmt_all_data_generate is '所有比赛数据产生时间'; -- Create/Recreate primary, unique and foreign key constraints alter table ASCR_CLUB_MEMBER_ACT_STATIS add constraint PK_ASCR_CLUB_MEMBER_ACT_STATIS primary key (ID) using index tablespace AISPORTCORE pctfree 10 initrans 2 maxtrans 255; alter table ASCR_CLUB_MEMBER_ACT_STATIS add constraint U_ASCR_CLB_MEM_ACT_STATIS_CMID unique (CLUB_MEMEBER_ID) using index tablespace AISPORTCORE pctfree 10 initrans 2 maxtrans 255; -- Create table create table ASCR_CLUB_ACTIVITY_STATISTICS ( id VARCHAR2(32) not null, club_id VARCHAR2(32) not null, total_create_activity_count NUMBER(15) not null, most_s_v_user_ids VARCHAR2(64), most_team_s_v_user_ids VARCHAR2(4000), gmt_create TIMESTAMP(6) not null, gmt_modified TIMESTAMP(6) not null, total_activity_joiner_count NUMBER(15) not null, max_s_v_count NUMBER(15) not null, max_team_s_v_count NUMBER(15) not null ) tablespace AISPORTCORE pctfree 10 initrans 1 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); -- Add comments to the table comment on table ASCR_CLUB_ACTIVITY_STATISTICS is '俱乐部活动统计'; -- Add comments to the columns comment on column ASCR_CLUB_ACTIVITY_STATISTICS.id is '主键id'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.club_id is '俱乐部id'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.total_create_activity_count is '总共举办活动次数'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.most_s_v_user_ids is '最多连胜数用户ids(SV是successional victory)(统计所有的)'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.most_team_s_v_user_ids is '组队连胜最多的用户id(多个用逗号间隔)(只统计双打和团体)'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.gmt_create is '创建时间'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.gmt_modified is '修改时间'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.total_activity_joiner_count is '总共的活动参与人数'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.max_s_v_count is '最大连胜数'; comment on column ASCR_CLUB_ACTIVITY_STATISTICS.max_team_s_v_count is '最大组队连胜数目'; -- Create/Recreate primary, unique and foreign key constraints alter table ASCR_CLUB_ACTIVITY_STATISTICS add constraint PK_ASCR_CLUB_ACTIVITY_STATS primary key (ID) using index tablespace AISPORTCORE pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); alter table ASCR_CLUB_ACTIVITY_STATISTICS add constraint U_ASCR_CLUB_ACTIVITY_STATS_CB unique (CLUB_ID) using index tablespace AISPORTCORE pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); -- Add/modify columns alter table AISPORTCORE.ASCR_CLUB_ACTIVITY_STATISTICS modify most_s_v_user_ids VARCHAR2(4000);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29990276/viewspace-1393889/ ,如需转载,请注明出处,否则将追究法律责任。