declarer_tables_auxiliaires

This pipeline declares the "auxiliary" tables, which are mainly used to create joins between principal tables.

It accepts the same arguments as the pipeline declarer_tables_principales.

Example

The plugin "SPIP Bisous" enables an author to send a poke to another author. It declares a table spip_bisous linking 2 members with the poke’s date using code as shown below. Note that the primary key is composed of 2 separate fields.

function bisous_declarer_tables_auxiliaires($auxiliary_tables){

	$spip_bisous = array(
		'id_donneur' => 'bigint(21) DEFAULT "0" NOT NULL',
		'id_receveur' => 'bigint(21) DEFAULT "0" NOT NULL',
		'date' => 'datetime DEFAULT "0000-00-00 00:00:00" NOT NULL'
	);
	
	$spip_bisous_key = array(
		'PRIMARY KEY' => 'id_donneur, id_receveur'
	);
	
	$auxiliary_tables['spip_bisous'] = array(
		'field' => &$spip_bisous,
		'key' => &$spip_bisous_key
	);
	
	return $auxiliary_tables;
}

Author Gilles Vincent Published : Updated : 12/03/23

Translations : English, Español, français