summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin/schema_inc.php5
-rw-r--r--admin/upgrade_inc.php2
2 files changed, 6 insertions, 1 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index cd21ac4..bebc728 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -35,7 +35,6 @@ $tables = array(
data X
CONSTRAINT '
, CONSTRAINT `liberty_content_status_ref` FOREIGN KEY (`content_status_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content_status`( `content_status_id` )
- , CONSTRAINT `liberty_content_attachment_ref` FOREIGN KEY (`primary_attachment_id`) REFERENCES `".BIT_DB_PREFIX."liberty_attachments`( `attachment_id` )
, CONSTRAINT `liberty_content_type_ref` FOREIGN KEY (`content_type_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_content_types`( `content_type_guid` )'
",
@@ -230,6 +229,10 @@ $indices = array (
);
$gBitInstaller->registerSchemaIndexes( LIBERTY_PKG_NAME, $indices );
+// Need to figure out how to add this constraint on liberty_content after the tables are created or the circular reference causes issues.
+// , CONSTRAINT `liberty_content_attachment_ref` FOREIGN KEY (`primary_attachment_id`) REFERENCES `".BIT_DB_PREFIX."liberty_attachments`( `attachment_id` )
+
+
// ### Sequences
$sequences = array (
'liberty_content_id_seq' => array( 'start' => 1 ),
diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php
index 2571404..a43271c 100644
--- a/admin/upgrade_inc.php
+++ b/admin/upgrade_inc.php
@@ -72,9 +72,11 @@ array( 'DATADICT' => array(
'object_id' => array( '`content_id`', 'I4' ),
),
)),
+ /* The installer can't add constraints after table creation yet so drop this constraint.
array( 'SQL' => array(
'ALTER TABLE `'.BIT_DB_PREFIX.'liberty_content` ADD CONSTRAINT liberty_content_attachment_ref FOREIGN KEY (primary_attachment_id) REFERENCES `'.BIT_DB_PREFIX.'liberty_attachments` (attachment_id)'
)),
+ */
)),