diff options
| author | lsces <lester@lsces.co.uk> | 2012-08-06 11:28:11 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2012-08-06 11:28:11 +0100 |
| commit | b0a607a5a76e7c46302fd882ce49eb6d21949474 (patch) | |
| tree | 329442d99dd87edf7423d36aa869d23f20f955c2 /admin | |
| parent | eb8f8ef40de6e51adb796f3b29eeb31536900f08 (diff) | |
| download | liberty-b0a607a5a76e7c46302fd882ce49eb6d21949474.tar.gz liberty-b0a607a5a76e7c46302fd882ce49eb6d21949474.tar.bz2 liberty-b0a607a5a76e7c46302fd882ce49eb6d21949474.zip | |
role model switch on liberty schema
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/schema_inc.php | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index b01dd99..7094829 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -220,6 +220,16 @@ $tables = array( ); +if ( defined( 'ROLE_MODEL' ) ) { + $tables['liberty_content_permissions'] = + " role_id I4 PRIMARY, + perm_name C(30) PRIMARY, + content_id I4 PRIMARY, + is_revoked C(1) + CONSTRAINT ' , CONSTRAINT `liberty_content_id_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`) ' + "; +} + global $gBitInstaller; foreach( array_keys( $tables ) AS $tableName ) { @@ -232,15 +242,6 @@ $constraints = array( 'liberty_process_queue' => array('liberty_process_queue_ref' => 'FOREIGN KEY (`content_id`) REFERENCES `'.BIT_DB_PREFIX.'liberty_content`( `content_id` )') ); -foreach( array_keys($constraints) AS $tableName ) { - $gBitInstaller->registerSchemaConstraints( LIBERTY_PKG_NAME, $tableName, $constraints[$tableName]); -} - - -$gBitInstaller->registerPackageInfo( LIBERTY_PKG_NAME, array( - 'description' => "Liberty is an integral part and manages all content on your site.", - 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', -) ); // ### Indexes $indices = array ( @@ -269,6 +270,22 @@ $indices = array ( 'lib_attachment_meta_type_idx' => array( 'table' => 'liberty_attachment_meta_data', 'cols' => 'meta_type_id', 'opts' => NULL ), 'lib_attachment_meta_title_idx' => array( 'table' => 'liberty_attachment_meta_data', 'cols' => 'meta_title_id', 'opts' => NULL ), ); + +if ( defined( 'ROLE_MODEL' ) ) { + $constraints['liberty_content_permissions'] = array('liberty_content_perm_role_ref' => 'FOREIGN KEY (`role_id`) REFERENCES `'.BIT_DB_PREFIX.'users_roles` (`role_id`)'); + unset($indices['liberty_content_perm_group_idx']); + $indices['liberty_content_perm_role_idx'] = array( 'table' => 'liberty_content_permissions', 'cols' => 'role_id', 'opts' => NULL ); + +} +foreach( array_keys($constraints) AS $tableName ) { + $gBitInstaller->registerSchemaConstraints( LIBERTY_PKG_NAME, $tableName, $constraints[$tableName]); +} + +$gBitInstaller->registerPackageInfo( LIBERTY_PKG_NAME, array( + 'description' => "Liberty is an integral part and manages all content on your site.", + 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', +) ); + $gBitInstaller->registerSchemaIndexes( LIBERTY_PKG_NAME, $indices ); // ### Sequences |
