--
--   This table stores information about parameters on packages.  Every package parameter
-- is specific to a particular package instance and is queryable with the Tcl call 
-- ad_parameter.
-- 
CREATE TABLE apm_parameters (
	parameter_id	 integer PRIMARY KEY NOT NULL,
	package_key	 varchar(100) NOT NULL,
	--
	--   This is the name of the parameter, for example "DebugP."
	-- 
	parameter_name	 varchar(100) NOT NULL,
	--
	--   A human readable description of what the parameter is used for.
	-- 
	description	 varchar(2000),
	section_name	 varchar(200),
	--
	--  Acceptable datatypes for parameters.  Currently only numbers and strings.
	--  XXX (bquinn): Integrate with acs objects metadata system.  It is not 
	--  currently so integrated because of fluctuations with the general 
	--  storage mechanism during development.
	-- 
	datatype	 varchar(100) NOT NULL,
	--
	--   The default value that any package instance will inherit unless otherwise
	--   specified. 
	-- 
	default_value	 text(-5),
	--
	--   The minimum number of values that this parameter can take.  Zero values means
	--   that the default is always enforced (but is somewhat pointless).  One value means that
	--   it can only be set to one value.  Increasing this number beyond one enables associating 
	--   a list of values with a parameter.  
	--   XXX (bquinn): More than one value is not supported by ad_parameter call at this time.
	-- 
	min_n_values	 integer DEFAULT 1 NOT NULL,
	--
	-- The maximum number of values that any attribute with this datatype
	--  can have. 
	-- 
	max_n_values	 integer DEFAULT 1 NOT NULL,
	scope	 varchar(10) DEFAULT 'instance'::character varying NOT NULL,
	CONSTRAINT apm_pack_param_type_fk REFERENCES apm_package_types (),
	CONSTRAINT apm_parameters_datatype_ck REFERENCES apm_package_types (),
	CONSTRAINT apm_parameters_fk REFERENCES apm_package_types (),
	CONSTRAINT apm_parameters_pk REFERENCES apm_package_types (),
	CONSTRAINT apm_parameters_scope_check REFERENCES apm_package_types (),
	CONSTRAINT apm_paramters_max_n_ck REFERENCES apm_package_types (),
	CONSTRAINT apm_paramters_min_n_ck REFERENCES apm_package_types (),
	CONSTRAINT apm_paramters_n_values_ck REFERENCES apm_package_types (),
	CONSTRAINT apm_paramters_n_values_ck REFERENCES acs_objects (),
	CONSTRAINT apm_pack_param_type_fk REFERENCES acs_objects (),
	CONSTRAINT apm_parameters_datatype_ck REFERENCES acs_objects (),
	CONSTRAINT apm_parameters_fk REFERENCES acs_objects (),
	CONSTRAINT apm_parameters_pk REFERENCES acs_objects (),
	CONSTRAINT apm_parameters_scope_check REFERENCES acs_objects (),
	CONSTRAINT apm_paramters_max_n_ck REFERENCES acs_objects (),
	CONSTRAINT apm_paramters_min_n_ck REFERENCES acs_objects ()
);

CREATE INDEX apm_parameters_package_idx ON apm_parameters (package_key);
CREATE UNIQUE INDEX apm_paramters_attr_name_un ON apm_parameters (parameter_name, package_key);

CREATE TRIGGER RI_ConstraintTrigger_c_340659 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_340660 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_340667 AFTER DELETE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_del (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_340668 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_upd (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_340724 AFTER INSERT FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_ins (disabled)
CREATE TRIGGER RI_ConstraintTrigger_c_340725 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_check_upd (disabled)

-- Tables with foreign keys that refer to apm_parameters:
--apm_parameter_values(apm_pack_param_type_fk)
--apm_parameter_values(apm_parameters_datatype_ck)
--apm_parameter_values(apm_parameters_fk)
--apm_parameter_values(apm_parameters_pk)
--apm_parameter_values(apm_parameters_scope_check)
--apm_parameter_values(apm_paramters_max_n_ck)
--apm_parameter_values(apm_paramters_min_n_ck)
--apm_parameter_values(apm_paramters_n_values_ck)

-- Table size: 147,456 bytes
-- Table rows: 510

Tables:

aa_test_final_resultscategory_search_resultsec_product_user_class_pricess5_package
aa_test_resultscategory_synonym_indexec_productssearch_observer_queue
acs_activitiescategory_synonymsec_products_auditsec_session_properties
acs_activity_object_mapcategory_tempec_refundssecret_tokens
acs_attribute_descriptionscategory_translationsec_retailer_locationssite_node_object_mappings
acs_attribute_valuescategory_tree_mapec_retailer_locations_auditsite_nodes
acs_attributescategory_tree_translationsec_retailerssite_nodes_selection
acs_contentscategory_treesec_retailers_auditsp_extant_files
acs_data_linkschat_msgsec_sale_pricessp_extant_folders
acs_datatypeschat_roomsec_sale_prices_auditsp_folders
acs_enum_valueschat_transcriptsec_sales_tax_by_statestatic_pages
acs_event_party_mapcode_keyword_map_tempec_sales_tax_by_state_auditsubsite_callbacks
acs_eventscomposition_relsec_shipmentssubsite_themes
acs_function_argscountriesec_shipments_auditsyndication
acs_logscountry_namesec_spam_logtarget_place_list
acs_magic_objectscr_child_relsec_subcat_prod_map_audittemplate_demo_notes
acs_mail_bodiescr_content_mime_type_mapec_subcategoriestime_intervals
acs_mail_body_headerscr_content_textec_subcategories_audittimespans
acs_mail_gc_objectscr_doc_filterec_subcategory_product_maptimezone_rules
acs_mail_linkscr_dummyec_subsubcat_prod_map_audittimezones
acs_mail_lite_bouncecr_extension_mime_type_mapec_subsubcategoriestmp_bt_save
acs_mail_lite_bounce_notifcr_extlinksec_subsubcategories_audittrackback_pings
acs_mail_lite_complex_queuecr_files_to_deleteec_subsubcategory_product_maptree_tmp
acs_mail_lite_email_src_ext_id_mapcr_folder_type_mapec_templatests
acs_mail_lite_email_uid_id_mapcr_foldersec_templates_audittxt
acs_mail_lite_from_externalcr_item_keyword_mapec_user_class_user_mapus_counties
acs_mail_lite_ie_headerscr_item_publish_auditec_user_class_user_map_auditus_states
acs_mail_lite_ie_part_nv_pairscr_item_relsec_user_classesuser_portraits
acs_mail_lite_ie_partscr_item_template_mapec_user_classes_audituser_preferences
acs_mail_lite_ie_section_ref_mapcr_itemsec_user_identificationuser_profiles
acs_mail_lite_imap_conncr_keywordsec_user_session_infousers
acs_mail_lite_mail_logcr_localesec_user_session_offer_codesusers_email_image
acs_mail_lite_queuecr_mime_typesec_user_sessionsview_aggregates
acs_mail_lite_send_msg_id_mapcr_newsemail_imagesview_aggregates_by_type
acs_mail_lite_uicr_release_periodsetp_page_revisionsviews_by_type
acs_mail_multipart_partscr_revision_attributesfaq_q_and_asviews_views
acs_mail_multipartscr_revisionsfaqsweblogger_blogroll_entries
acs_mail_queue_incomingcr_scheduled_release_jobforums_forumsweblogger_channels
acs_mail_queue_messagescr_scheduled_release_logforums_messagesweblogger_ping_urls
acs_mail_queue_outgoingcr_symlinksforums_reading_infoweblogger_technorati_cache
acs_messagescr_template_use_contextsfs_root_folderswf_arcs
acs_messages_outgoingcr_templatesfs_rss_subscrswf_article_cases
acs_named_objectscr_textfs_simple_objectswf_attribute_value_audit
acs_object_type_tablescr_type_childrenfs_urlswf_case_assignments
acs_object_typescr_type_relationsfts_confwf_case_deadlines
acs_objectscr_type_template_mapfts_unknown_lexemwf_cases
acs_permissionscr_wp_file_attachmentsgeneral_commentswf_context_assignments
acs_permissions_lockcr_wp_image_attachmentsgeneral_objectswf_context_role_info
acs_privilege_hierarchycr_wp_presentationsget_path_abs_cursorwf_context_task_panels
acs_privilegescr_wp_presentations_audget_path_cursorswf_context_transition_info
acs_reference_repositoriescr_wp_presentations_backget_path_rel_cursorwf_context_workflow_info
acs_rel_rolescr_wp_slidesgithub_activitywf_contexts
acs_rel_typescr_wp_slides_bullet_itemsgroup_element_indexwf_places
acs_relscr_wp_slides_postamblegroup_relswf_roles
acs_sc_bindingscr_wp_slides_preamblegroup_type_relswf_task_assignments
acs_sc_contractscr_xml_docsgroup_typeswf_tasks
acs_sc_impl_aliasesdav_site_node_folder_mapgroupswf_tokens
acs_sc_implsdownload_archive_descsguard_listwf_transition_attribute_map
acs_sc_msg_type_elementsdownload_archive_metadatahost_node_mapwf_transition_role_assign_map
acs_sc_msg_typesdownload_archive_revisionsimageswf_transitions
acs_sc_operationsdownload_archive_typesjournal_entrieswf_workflows
acs_static_attr_valuesdownload_archiveslang_message_keysworkflow_action_allowed_roles
ad_locale_user_prefsdownload_downloadslang_messagesworkflow_action_callbacks
ad_localesdownload_metadata_choiceslang_messages_auditworkflow_action_privileges
ad_template_sample_usersdownload_reasonslang_translate_columnsworkflow_actions
admin_relsdownload_repositorylang_translation_registryworkflow_callbacks
apm_applicationsdownload_revision_datalang_user_timezoneworkflow_case_action_assignees
apm_package_callbacksec_addresseslanguage_639_2_codesworkflow_case_enabled_actions
apm_package_dependenciesec_admin_settingslanguage_codesworkflow_case_fsm
apm_package_downloadsec_admin_settings_auditlob_dataworkflow_case_log
apm_package_ownersec_automatic_email_loglobsworkflow_case_log_data
apm_package_typesec_canned_responsesmembership_relsworkflow_case_log_rev
apm_package_version_attrec_cat_mailing_listsmigr_category_mapworkflow_case_role_party_map
apm_package_versionsec_categoriesmigr_forum_mapworkflow_cases
apm_packagesec_categories_auditmigr_message_mapworkflow_deputies
apm_parameter_valuesec_category_product_mapmigr_user_mapworkflow_fsm_action_en_in_st
apm_parametersec_category_product_map_auditnntp_articlesworkflow_fsm_actions
apm_servicesec_category_template_mapnntp_groupsworkflow_fsm_states
application_groupsec_creditcardsnotification_delivery_methodsworkflow_role_allowed_parties
attachmentsec_cs_action_info_used_mapnotification_email_holdworkflow_role_callbacks
attachments_fs_root_folder_mapec_cs_issue_type_mapnotification_intervalsworkflow_role_default_parties
auth_authoritiesec_custom_p_field_values_auditnotification_repliesworkflow_roles
auth_batch_job_entriesec_custom_product_field_valuesnotification_requestsworkflows
auth_batch_jobsec_custom_product_fieldsnotification_typeswp_styles
auth_driver_paramsec_custom_product_fields_auditnotification_types_del_methodsxolirc_package
bm_bookmarksec_customer_serv_interactionsnotification_types_intervalsxooauth_authorized_users
bm_in_closed_pec_customer_service_actionsnotification_user_mapxooauth_client_credentials
bm_urlsec_customer_service_issuesnotificationsxooauth_client_metadata
bt_bug_revisionsec_email_templatesoct_ballotxooauth_credentials
bt_bugsec_email_templates_auditoct_candidatexooauth_packages
bt_bugs_tempec_financial_transactionsoct_electionxooauth_server_metadata
bt_componentsec_gift_certificate_usageoct_votexooauth_temp_credentials
bt_default_keywordsec_gift_certificatespa_albumsxooauth_token_credentials
bt_keyword_component_mapec_gift_certificates_auditpa_collection_photo_mapxowf_package
bt_patch_actionsec_itemspa_collectionsxowiki_autonames
bt_patch_bug_mapec_offerspa_package_root_folder_mapxowiki_file
bt_patchesec_offers_auditpa_photosxowiki_form
bt_priority_codesec_orderspagesxowiki_form_instance_item_index
bt_projectsec_picklist_itemspartiesxowiki_form_page
bt_severity_codesec_picklist_items_auditparty_approved_member_mapxowiki_last_visited
bt_user_prefsec_problems_logpersonsxowiki_object
bt_versionsec_product_commentspinds_blog_categoriesxowiki_package
btbug_revisionsec_product_comments_auditpinds_blog_entriesxowiki_page
cal_item_typesec_product_linksprevious_place_listxowiki_page_instance
cal_itemsec_product_links_auditproject_tempxowiki_page_template
cal_party_prefsec_product_purchase_combrc_segment_required_seg_mapxowiki_plain_page
cal_uidsec_product_recommend_auditrecurrence_interval_typesxowiki_podcast_item
calendarsec_product_recommendationsrecurrencesxowiki_references
categoriesec_product_reviewsrel_constraintsxowiki_tags
category_linksec_product_reviews_auditrel_segmentsxowiki_unresolved_references
category_object_mapec_product_series_maprequest_monitor_activities
category_searchec_product_series_map_auditrequest_monitor_community_activities
category_search_indexec_product_u_c_prices_auditrss_gen_subscrs