Dotclear

source: plugins/filesAlias/_install.php @ 1850

Revision 1850, 1.3 KB checked in by Osku, 14 years ago (diff)

filesAlias : initial commit

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3#
4# This file is part of filesAlias, a plugin for Dotclear 2.
5#
6# Copyright (c) 2009 Osku and contributors
7#
8# Licensed under the GPL version 2.0 license.
9# A copy of this license is available in LICENSE file or at
10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11#
12# -- END LICENSE BLOCK ------------------------------------
13if (!defined('DC_CONTEXT_ADMIN')) { return; }
14
15$version = $core->plugins->moduleInfo('filesAlias','version');
16
17if (version_compare($core->getVersion('filesAlias'),$version,'>=')) {
18     return;
19}
20
21/* Database schema
22-------------------------------------------------------- */
23$s = new dbStruct($core->con,$core->prefix);
24
25$s->filesalias
26     ->blog_id('varchar',32,false)
27     ->filesalias_url('varchar',255,false)
28     ->filesalias_destination('varchar',255,false)
29     ->filesalias_position('smallint',0,false,1)
30     
31     ->primary('pk_filesalias','blog_id','filesalias_url')
32     
33     ->index('idx_filesalias_blog_id','btree','blog_id')
34     ->index('idx_filesalias_blog_id_filesalias_position','btree','blog_id','filesalias_position')
35     
36     ->reference('fk_filesalias_blog','blog_id','blog','blog_id','cascade','cascade')
37     ;
38
39# Schema installation
40$si = new dbStruct($core->con,$core->prefix);
41$changes = $si->synchronize($s);
42
43$core->setVersion('filesAlias',$version);
44return true;
45?>
Note: See TracBrowser for help on using the repository browser.

Sites map