Dotclear

source: plugins/meuh/_install.php @ 2223

Revision 2223, 1.3 KB checked in by bruno, 14 years ago (diff)

New plugin : meuh 0.2

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3#
4# This file is part of Meuh,
5# a plugin for DotClear2.
6#
7# Copyright (c) 2010 Bruno Hondelatte and contributors
8#
9# Licensed under the GPL version 2.0 license.
10# See LICENSE file or
11# http://www.gnu.org/licenses/gpl-2.0.txt
12#
13# -- END LICENSE BLOCK ------------------------------------
14
15if (!defined('DC_CONTEXT_ADMIN')) { return; }
16
17$version = $core->plugins->moduleInfo('meuh','version');
18
19if (version_compare($core->getVersion('meuh'),$version,'>=')) {
20     return;
21}
22
23/* Database schema
24-------------------------------------------------------- */
25$s = new dbStruct($core->con,$core->prefix);
26
27$s->meuh
28     ->blog_id           ('varchar',    32,  false)
29     ->post_type         ('varchar',    32,  false,    "'post'")
30     ->post_url          ('varchar',    255, false)
31     ->meuh_url          ('varchar',    255, false)
32     ->meuh_count        ('integer',    0,   false,0)
33     ->meuh_lastread     ('timestamp',  0,   false,    'now()')
34     
35     ->primary('pk_meuh','blog_id','post_type','meuh_url')
36     
37     ->index('idx_meuh_blog_id','btree','blog_id')
38     
39     ->reference('fk_meuh_blog','blog_id','blog','blog_id','cascade','cascade')
40     ;
41
42# Schema installation
43$si = new dbStruct($core->con,$core->prefix);
44$changes = $si->synchronize($s);
45
46$core->setVersion('meuh',$version);
47return true;
48?>
Note: See TracBrowser for help on using the repository browser.

Sites map