Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Jobs Sanity Check Index DDL scrips
Description Columns Primary key Check Constraints Foreign keys Unique Keys Options Indexes Referenced by Triggers Partitions

RHNCHANNELCLONED

DDL script

Columns

NameTypeNullableDefault valueComment
ORIGINAL_IDNUMBER(38)N  
IDNUMBER(38)N  
CREATEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  
MODIFIEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  

Primary key:

Constraint NameColumns
RHN_CHANNELCLONE_ID_PKID

Foreign Keys:

Constraint NameColumnsReferenced tableReferenced ConstraintOn Delete Rule
RHN_CHANNELCLONE_FCID_FKORIGINAL_ID RHNCHANNEL RHN_CHANNEL_ID_PK CASCADE
RHN_CHANNELCLONE_TCID_FKID RHNCHANNEL RHN_CHANNEL_ID_PK CASCADE

Unique Keys:

Constraint nameColumns
RHN_CHANNELCLONE_FCID_TCID_UQORIGINAL_ID , ID

Options:

OptionSettings
TablespaceUSERS
Index OrganizedNo
Generated by OracleNo
ClusteredNo
NestedNo
TemporaryNo

Indexes:

Index NameTypeUnuquenessColumnsDDL script
RHN_CHANNELCLONE_FCID_TCID_IDXNORMALNONUNIQUEORIGINAL_ID , ID DDL script
RHN_CHANNELCLONE_ID_PKNORMALUNIQUEID DDL script

Triggers

RHN_CHANNEL_CLONED_COMPS_TRIG

Legend: comment string keyword reserved word operator
CREATE TRIGGER 
rhn_channel_cloned_comps_trig
before insert or update on rhnChannelCloned
for each row

REFERENCING NEW AS NEW OLD AS OLD
begin
	:new.modified := current_timestamp;

	if inserting then
		-- if there are not comps in the cloned channel by now,
		-- we shall clone comps from the original channel
		insert into rhnChannelComps
			( id, channel_id, comps_type_id, relative_filename,
				last_modified, created, modified )
		select rhn_channelcomps_id_seq.nextval, :new.id, comps_type_id, relative_filename,
				current_timestamp, current_timestamp, current_timestamp
		from rhnChannelComps
		where channel_id = :new.original_id
			and not exists (
				select 1
				from rhnChannelComps x
				where x.channel_id = :new.id
			);
	end if;
end;