diff -urN family/common.inc drupal/modules/family/common.inc
--- family/common.inc	2006-04-30 19:59:21.000000000 -0500
+++ drupal/modules/family/common.inc	2007-09-26 01:39:17.580734250 -0500
@@ -31,8 +31,8 @@
     $removed = family_remove_fact($sub_fid, $fid);
   }
   //Remove both the fact & relationship to parent facts
-  db_query("DELETE FROM family_relations WHERE fid1 = %d", $fid);
-  db_query("DELETE FROM family_facts WHERE fid = %d", $fid);
+  db_query("DELETE FROM {family_relations} WHERE fid1 = %d", $fid);
+  db_query("DELETE FROM {family_facts} WHERE fid = %d", $fid);
 }
 
 function family_insert_relation($fid1, $fid2, $desc) {
diff -urN family/family.info drupal/modules/family/family.info
--- family/family.info	1969-12-31 18:00:00.000000000 -0600
+++ drupal/modules/family/family.info	2007-09-17 21:39:16.000000000 -0500
@@ -0,0 +1,3 @@
+; $Id: family.info,v 5.x-1.x-dev 2007/09/17 22:14:00 pyutaros $
+name = Family Tree
+description = Adds a family tree to your Drupal website using Drupal nodes and relational database.
diff -urN family/family.install drupal/modules/family/family.install
--- family/family.install	1969-12-31 18:00:00.000000000 -0600
+++ drupal/modules/family/family.install	2007-09-26 01:28:21.211247750 -0500
@@ -0,0 +1,80 @@
+<?php
+// $Id: family.install,v 1.3 2006/08/24 11:49:53 karens Exp $
+
+function family_install() {
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+/* ---------------------------------
+-- FACTS Table
+-- fid: fact id (incremental index)
+-- nid: node id. NULL if it is not a node
+-- fact_code: a code of 3-4 letters that define the fact type. It uses the standard GEDCOM tag types 
+--           (e.g. INDI, BIRT, NAME, SEX, PLAC). We might define more options for our needs.
+-- xref: XREF_ID record identifier from GEDCOM
+-- fact_value: The value of the fact, depend on fact_code. e.g. a name for NAME fact or a date for a date fact.
+-- gedcom_source: The GEDCOM source code that defines the fact, typically a single line.
+--
+-- RELATIONS Table
+-- rid: relation id (incremental index)
+-- fid1, fid2: fact id's of the two facts
+-- relation_description: the relation of fid1 to fid2
+-- gedcom_source: The GEDCOM source code that defines the relation, typically a single line.
+--                Used only for a code that only defines a relation, such as CHIL,WIFE,HUSB.
+--                Otherwise the source code is included in the fact record.
+-- --------------------------------- */
+      db_query("
+	CREATE TABLE {family_facts} (
+	    fid INT(10) UNSIGNED NOT NULL PRIMARY KEY,
+	    nid INT(10) UNSIGNED,
+	    fact_code varchar(4),
+	    xref varchar(20),
+	    fact_value varchar(255),
+	    gedcom_source TEXT
+	) TYPE = MyISAM;
+      ");
+      db_query("
+	CREATE TABLE {family_relations} (
+	    rid INT(10) UNSIGNED PRIMARY KEY,
+	    fid1 INT(10) UNSIGNED NOT NULL,
+	    fid2 INT(10) UNSIGNED NOT NULL,
+	    relation_description TEXT,
+	    gedcom_source TEXT,
+	    FOREIGN KEY (fid1) REFERENCES facts(fid),
+	    FOREIGN KEY (fid2) REFERENCES facts(fid)
+	) TYPE = MyISAM
+      ");
+      break;
+    case 'pgsql':
+      db_query("
+	CREATE TABLE {family_facts} (
+	    fid INT(10) UNSIGNED NOT NULL PRIMARY KEY,
+	    nid INT(10) UNSIGNED,
+	    fact_code varchar(4),
+	    xref varchar(20),
+	    fact_value varchar(255),
+	    gedcom_source TEXT
+	)
+      ");
+      db_query("
+	CREATE TABLE {family_relations} (
+	    rid INT(10) UNSIGNED PRIMARY KEY,
+	    fid1 INT(10) UNSIGNED NOT NULL,
+	    fid2 INT(10) UNSIGNED NOT NULL,
+	    relation_description TEXT,
+	    gedcom_source TEXT,
+	    FOREIGN KEY (fid1) REFERENCES facts(fid),
+	    FOREIGN KEY (fid2) REFERENCES facts(fid)
+	)
+      ");
+      break;
+  }
+}
+
+function family_uninstall() {
+    db_query('DROP TABLE {family_relations}');
+    db_query('DROP TABLE {family_facts}');
+    db_query("DELETE FROM {variable} WHERE name LIKE 'family_%'");
+}
+
+
diff -urN family/family.mysql drupal/modules/family/family.mysql
--- family/family.mysql	2006-04-30 19:59:21.000000000 -0500
+++ drupal/modules/family/family.mysql	1969-12-31 18:00:00.000000000 -0600
@@ -1,54 +0,0 @@
--- MySQL Schema for the Drupal module 'Family'.
--- By Amnon Jonas 3-Dec-2005
--- This is a simple database format that uses only two tables.
--- The facts table defines all the data, a record for each piece, e.g. individual, family, birth event, a date or a place.
--- The relations ties between the facts, e.g. between a child and his family or between an event to its date.
--- Every fact may be a node. It is done by including a non-null nid (node id).
--- Most GEDCOM lines are represented by a single fact records that is tied to his parent using a relations record
--- Some GEDCOM lines like CHIL, HUSB or WIFE define additional relations and don't add a fact record.
--- Relations to external nodes will be defined using clipper module
-
-DROP TABLE IF EXISTS family_relations;
-DROP TABLE IF EXISTS family_facts;
-
--- ---------------------------------
--- FACTS Table
--- fid: fact id (incremental index)
--- nid: node id. NULL if it is not a node
--- fact_code: a code of 3-4 letters that define the fact type. It uses the standard GEDCOM tag types 
---           (e.g. INDI, BIRT, NAME, SEX, PLAC). We might define more options for our needs.
--- xref: XREF_ID record identifier from GEDCOM
--- fact_value: The value of the fact, depend on fact_code. e.g. a name for NAME fact or a date for a date fact.
--- gedcom_source: The GEDCOM source code that defines the fact, typically a single line.
--- ---------------------------------
-CREATE TABLE family_facts (
-    fid INT(10) UNSIGNED NOT NULL PRIMARY KEY,
-    nid INT(10) UNSIGNED,
-    fact_code varchar(4),
-    xref varchar(20),
-    valuefact_value varchar(255),
-    gedcom_source TEXT
-) TYPE = MyISAM;
-
--- -------------------------------------------------------------------------- --
--- ---------------------------------
--- RELATIONS Table
--- rid: relation id (incremental index)
--- fid1, fid2: fact id's of the two facts
--- relation_description: the relation of fid1 to fid2
--- gedcom_source: The GEDCOM source code that defines the relation, typically a single line.
---                Used only for a code that only defines a relation, such as CHIL,WIFE,HUSB.
---                Otherwise the source code is included in the fact record.
--- ---------------------------------
---
-CREATE TABLE family_relations (
-    rid INT(10) UNSIGNED PRIMARY KEY,
-    fid1 INT(10) UNSIGNED NOT NULL,
-    fid2 INT(10) UNSIGNED NOT NULL,
-    relation_description TEXT,
-    gedcom_source TEXT,
-    FOREIGN KEY (fid1) REFERENCES facts(fid),
-    FOREIGN KEY (fid2) REFERENCES facts(fid)
-) TYPE = MyISAM;
--- -------------------------------------------------------------------------- --
-
diff -urN family/import.inc drupal/modules/family/import.inc
--- family/import.inc	2006-04-30 19:59:21.000000000 -0500
+++ drupal/modules/family/import.inc	2007-09-26 02:05:43.180531500 -0500
@@ -31,8 +31,9 @@
   $gedcom_hier=array();   // References to GEDCOM parents on each level
 //Empty current content. This is useful for debugging, but more caution should be
 //done before deleting database in the working version
-  db_query("TRUNCATE family_facts");
-  db_query("TRUNCATE family_relations");
+  db_query("TRUNCATE {family_facts}");
+  db_query("TRUNCATE {family_relations}");
+  // XXX Also delete nodes referenced by family_facts? -- PF
 
   while (!feof ($fp)) {
     $gedline = fgets( $fp, 1024 );
@@ -88,13 +89,10 @@
           }
           unset($node);
         }
-        else {
 
-// Add fact that is not a node
-          db_query("INSERT INTO {family_facts} (fid, nid, xref, fact_code, fact_value,
-                         gedcom_source) VALUES (%d, %d, '%s', '%s', '%s', '%s')", $fid,
-                        $nid, $xref,$fact_code,$value,$gedcom_source);
-        }
+        db_query("INSERT INTO {family_facts} (fid, nid, xref, fact_code, fact_value, gedcom_source)
+	          VALUES (%d, %d, '%s', '%s', '%s', '%s')",
+		  $fid, $nid, $xref,$fact_code,$value,$gedcom_source);
         $gedcom_hier[$level] = $fid;
         $gedcom_source=null; // If the source is in fact table, no need to put it again in relation table
       }
@@ -109,7 +107,7 @@
   }
   fclose ($fp);
   //Clean it all up
-  $fids = db_query("SELECT fid FROM family_facts WHERE fact_code = 'INDI'");
+  $fids = db_query("SELECT fid FROM {family_facts} WHERE fact_code = 'INDI'");
   while ($fid = db_fetch_array($fids)) {
     family_import_cleanup_indinode($fid['fid']);
   }
diff -urN family/view.inc drupal/modules/family/view.inc
--- family/view.inc	2006-04-30 19:59:21.000000000 -0500
+++ drupal/modules/family/view.inc	2007-09-26 01:39:52.162895500 -0500
@@ -1,7 +1,7 @@
 <?php
 // $Id: view.inc,v 1.3 2006/05/01 00:59:21 amnonj Exp $
 function family_make_link($fid, $text) {
-  $nid = db_result(db_query("SELECT nid FROM family_facts WHERE fid = %d", $fid));
+  $nid = db_result(db_query("SELECT nid FROM {family_facts} WHERE fid = %d", $fid));
   $output = "<a href=\"/node/".$nid."\">";
   $output .= $text;
   $output .= "</a>";
