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

RHNPACKAGE

DDL script

Columns

NameTypeNullableDefault valueComment
IDNUMBER(38)N  
ORG_IDNUMBER(38)Y  
NAME_IDNUMBER(38)N  
EVR_IDNUMBER(38)N  
PACKAGE_ARCH_IDNUMBER(38)N  
PACKAGE_GROUPNUMBER(38)Y  
RPM_VERSIONVARCHAR2(16)Y  
DESCRIPTIONVARCHAR2(4000)Y  
SUMMARYVARCHAR2(4000)Y  
PACKAGE_SIZENUMBER(38)N  
PAYLOAD_SIZENUMBER(38)Y  
INSTALLED_SIZENUMBER(38)Y  
BUILD_HOSTVARCHAR2(256)Y  
BUILD_TIMETIMESTAMP(6)Y  
SOURCE_RPM_IDNUMBER(38)Y  
CHECKSUM_IDNUMBER(38)N  
VENDORVARCHAR2(64)N  
PAYLOAD_FORMATVARCHAR2(32)Y  
COMPATNUMBER(1)Y(0)  
PATHVARCHAR2(1000)Y  
HEADER_SIGVARCHAR2(64)Y  
COPYRIGHTVARCHAR2(128)Y  
COOKIEVARCHAR2(128)Y  
LAST_MODIFIEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  
CREATEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  
MODIFIEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  
HEADER_STARTNUMBER(38)N(-1)  
HEADER_ENDNUMBER(38)N(-1)  
MULTI_ARCHVARCHAR2(16)Y  

Primary key:

Constraint NameColumns
RHN_PACKAGE_ID_PKID

Check Constraints:

Constraint NameCheck Condition
RHN_PACKAGE_COMPAT_CHECKcompat in ( 1 , 0 )

Foreign Keys:

Constraint NameColumnsReferenced tableReferenced ConstraintOn Delete Rule
RHN_PACKAGE_CHSUM_FKCHECKSUM_ID RHNCHECKSUM RHNCHECKSUM_PK NO ACTION
RHN_PACKAGE_EID_FKEVR_ID RHNPACKAGEEVR RHN_PE_ID_PK NO ACTION
RHN_PACKAGE_GROUP_FKPACKAGE_GROUP RHNPACKAGEGROUP RHN_PACKAGE_GROUP_ID_PK NO ACTION
RHN_PACKAGE_NID_FKNAME_ID RHNPACKAGENAME RHN_PN_ID_PK NO ACTION
RHN_PACKAGE_OID_FKORG_ID WEB_CUSTOMER WEB_CUSTOMER_ID_PK CASCADE
RHN_PACKAGE_PAID_FKPACKAGE_ARCH_ID RHNPACKAGEARCH RHN_PARCH_ID_PK NO ACTION
RHN_PACKAGE_SRCRPMID_FKSOURCE_RPM_ID RHNSOURCERPM RHN_SOURCERPM_ID_PK NO ACTION

Options:

OptionSettings
TablespaceUSERS
Index OrganizedNo
Generated by OracleNo
ClusteredNo
NestedNo
TemporaryNo

Indexes:

Index NameTypeUnuquenessColumnsDDL script
RHN_PACKAGE_ID_PKNORMALUNIQUEID DDL script
RHN_PACKAGE_NID_ID_IDXNORMALNONUNIQUENAME_ID , ID DDL script
RHN_PACKAGE_OID_ID_IDXNORMALNONUNIQUEORG_ID , ID DDL script

Referenced by:

TableConstraint
RHNCHANNELNEWESTPACKAGE RHN_CNP_PID_FK
RHNCHANNELPACKAGE RHN_CP_PID_FK
RHNERRATAFILEPACKAGETMP RHN_EFILEPTMP_PID_FK
RHNERRATAFILEPACKAGE RHN_EFILEP_PID_FK
RHNERRATAPACKAGETMP RHN_ERR_PKGTMP_PID_FK
RHNERRATAPACKAGE RHN_ERR_PKG_PID_FK
RHNPACKAGEFILE RHN_PACKAGE_FILE_PID_FK
RHNPACKAGEKEYASSOCIATION RHN_PKEYA_PID_FK
RHNPACKAGEREPODATA RHN_PKEY_RD_PID_FK
RHNPACKAGEBREAKS RHN_PKG_BRKS_PACKAGE_FK
RHNPACKAGECHANGELOGREC RHN_PKG_CLR_PID_FK
RHNPACKAGECONFLICTS RHN_PKG_CONFLICTS_PACKAGE_FK
RHNPACKAGEENHANCES RHN_PKG_ENH_PACKAGE_FK
RHNPACKAGEOBSOLETES RHN_PKG_OBSOLETES_PACKAGE_FK
RHNPACKAGEPREDEPENDS RHN_PKG_PDEP_PACKAGE_FK
RHNPACKAGEPROVIDES RHN_PKG_PROVIDES_PACKAGE_FK
RHNPACKAGERECOMMENDS RHN_PKG_REC_PACKAGE_FK
RHNPACKAGEREQUIRES RHN_PKG_REQUIRES_PACKAGE_FK
RHNPACKAGESUGGESTS RHN_PKG_SUGG_PACKAGE_FK
RHNPACKAGESUPPLEMENTS RHN_PKG_SUPP_PACKAGE_FK
RHNSERVERNEEDEDCACHE RHN_SNCP_PID_FK

Triggers

RHN_PACKAGE_MOD_TRIG

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

REFERENCING NEW AS NEW OLD AS OLD
begin
	-- when we do a sat sync, we use last_modified to keep track
	-- of the upstream modification date.  So if we're setting
	-- it explicitly, don't override with current_timestamp.  But if we're
	-- not changing it, then this is a genuine update that needs
	-- tracking.
	--
	-- we're not using is_satellite() here instead, because we
	-- might want to use this to keep webdev in sync.
	if (:new.last_modified = :old.last_modified) or (:new.last_modified is null) then
		:new.last_modified := current_timestamp;
	end if;
	:new.modified := current_timestamp;

        -- bz 619337 if we are updating the checksum, we need to
        -- update the last modified time on all the channels the package is in
        if :new.checksum_id != :old.checksum_id then
            update rhnChannel
              set last_modified = current_timestamp
              where id in (select channel_id
                              from rhnChannelPackage
                              where package_id = :new.id);
            insert into rhnRepoRegenQueue (id, CHANNEL_LABEL, REASON)
                   (select rhn_repo_regen_queue_id_seq.nextval, C.label, 'checksum modification'
                    from rhnChannel C inner join
                         rhnChannelPackage CP on CP.channel_id = C.id
                    where CP.package_id = :new.id);
            delete from rhnPackageRepodata where package_id = :new.id;
        end if;

end;