<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://truxwiki.com/index.php?action=history&amp;feed=atom&amp;title=Truxton_relation_destroy</id>
	<title>Truxton relation destroy - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://truxwiki.com/index.php?action=history&amp;feed=atom&amp;title=Truxton_relation_destroy"/>
	<link rel="alternate" type="text/html" href="https://truxwiki.com/index.php?title=Truxton_relation_destroy&amp;action=history"/>
	<updated>2026-09-09T18:28:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://truxwiki.com/index.php?title=Truxton_relation_destroy&amp;diff=3216&amp;oldid=prev</id>
		<title>Sam: Created page with &quot;This destroys a relation object.  =Syntax= &lt;source lang=&quot;C&quot;&gt; void truxton_relation_destroy(uint64_t relation_handle); &lt;/source&gt;  =Parameters= ==&lt;code&gt;relation_handle&lt;/code&gt;==...&quot;</title>
		<link rel="alternate" type="text/html" href="https://truxwiki.com/index.php?title=Truxton_relation_destroy&amp;diff=3216&amp;oldid=prev"/>
		<updated>2021-01-10T18:27:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This destroys a relation object.  =Syntax= &amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt; void truxton_relation_destroy(uint64_t relation_handle); &amp;lt;/source&amp;gt;  =Parameters= ==&amp;lt;code&amp;gt;relation_handle&amp;lt;/code&amp;gt;==...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This destroys a relation object.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
void truxton_relation_destroy(uint64_t relation_handle);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Parameters=&lt;br /&gt;
==&amp;lt;code&amp;gt;relation_handle&amp;lt;/code&amp;gt;==&lt;br /&gt;
The relation object to free.&lt;br /&gt;
This handle comes from calling &amp;lt;code&amp;gt;[[truxton_relation_create]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Sample=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot; highlight=&amp;quot;28&amp;quot;&amp;gt;&lt;br /&gt;
void set_primary_photo( uint64_t truxton, uint64_t media, uint64_t child_file )&lt;br /&gt;
{&lt;br /&gt;
   char media_id[ 65 ];&lt;br /&gt;
   char file_id[ 65 ];&lt;br /&gt;
   &lt;br /&gt;
   truxton_media_get_id( media, media_id, sizeof( media_id ) );&lt;br /&gt;
   truxton_child_file_get_id( child_file, file_id, sizeof( file_id ) );&lt;br /&gt;
&lt;br /&gt;
   uint64_t relation = truxton_relation_create( truxton );&lt;br /&gt;
&lt;br /&gt;
   // Now tell Truxton that child_file (A object) is the primary photo of media (B object)&lt;br /&gt;
   truxton_relation_set_relation( relation, RELATION_PRIMARY_PHOTO );&lt;br /&gt;
&lt;br /&gt;
   // Set the A object, A is a file&lt;br /&gt;
   truxton_relation_set_a_id( relation, file_id );&lt;br /&gt;
   truxton_relation_set_a_type( relation, OBJECT_TYPE_FILE );&lt;br /&gt;
&lt;br /&gt;
   // Set the B object, B is a piece of media&lt;br /&gt;
   truxton_relation_set_b_id( relation, media_id );&lt;br /&gt;
   truxton_relation_set_b_type( relation, OBJECT_TYPE_MEDIA );&lt;br /&gt;
&lt;br /&gt;
   // Set the source object, source is a piece of media&lt;br /&gt;
   truxton_relation_set_source_id( relation, media_id );&lt;br /&gt;
   truxton_relation_set_source_type( relation, OBJECT_TYPE_MEDIA );&lt;br /&gt;
&lt;br /&gt;
   // Commit the data to the database&lt;br /&gt;
   truxton_relation_save( relation );&lt;br /&gt;
   truxton_relation_destroy( relation );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sam</name></author>
		
	</entry>
</feed>