diff sites/all/modules/relation/relation_endpoint.install @ 4:ce11bbd8f642

added modules
author danieleb <danielebarchiesi@me.com>
date Thu, 19 Sep 2013 10:38:44 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sites/all/modules/relation/relation_endpoint.install	Thu Sep 19 10:38:44 2013 +0100
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @file
+ * Installation functions for Relation Endpoint field type module.
+ */
+
+/**
+ * Implements hook_field_schema().
+ */
+function relation_endpoint_field_schema() {
+  $columns = array(
+    'entity_type' => array(
+      'type' => 'varchar',
+      'length' => 255,
+      'not null' => TRUE,
+      'default' => '',
+      'description' => 'Entity_type of this relation end-point.',
+    ),
+    'entity_id' => array(
+      'type' => 'int',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'default' => 0,
+      'description' => 'Entity_id of this relation end-point.',
+    ),
+    'r_index' => array(
+      'type' => 'int',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'default' => 0,
+      'description' => 'The index of this row in this relation. The highest index in the relation is stored as "arity" in the relation table.',
+    ),
+  );
+  return array(
+    'columns' => $columns,
+    'indexes' => array(
+      'relation' => array('entity_type', 'entity_id', 'r_index'),
+    ),
+  );
+}