source: branches/2.2/filemanager/setup/default_records.inc.php @ 4207

Revision 4207, 3.5 KB checked in by roberto.santosjunior, 13 years ago (diff)

Ticket #1827 - Correção do script de criação da app file manager

Line 
1<?php
2  /**************************************************************************\
3  * eGroupWare - Setup                                                       *
4  * http://www.egroupware.org                                                *
5  * --------------------------------------------                             *
6  *  This program is free software; you can redistribute it and/or modify it *
7  *  under the terms of the GNU General Public License as published by the   *
8  *  Free Software Foundation; either version 2 of the License, or (at your  *
9  *  option) any later version.                                              *
10  \**************************************************************************/
11
12        // CREATE TABLE PHPGW_VFS
13        $res_exists = $oProc->query("select count(*) from information_schema.tables where table_name = 'phpgw_vfs'");
14    $oProc->next_record();
15    if(!$oProc->f(0)) {
16                $oProc->query("CREATE TABLE phpgw_vfs ( file_id integer DEFAULT nextval(('seq_phpgw_vfs'::text)::regclass) NOT NULL,
17                                        owner_id integer NOT NULL,
18                                        createdby_id integer,
19                                        modifiedby_id integer,
20                                        created date DEFAULT '1970-01-01'::date NOT NULL,
21                                        modified date,
22                                        size integer,
23                                        mime_type character varying(200),
24                                        deleteable character(1) DEFAULT 'Y'::bpchar,
25                                        comment character varying(255),
26                                        app character varying(25),
27                                        directory character varying(255),
28                                        name character varying(128) NOT NULL,
29                                        link_directory character varying(255),
30                                        link_name character varying(128),
31                                        version character varying(30) DEFAULT '0.0.0.0'::character varying NOT NULL,
32                                        content text,
33                                        type integer DEFAULT 0,
34                                        summary bytea
35                                        );");
36       
37                // CREATE SEQUENCE
38                $oProc->query("CREATE SEQUENCE seq_phpgw_vfs INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;");
39       
40                // SET VALUE SEQUENCE
41                $oProc->query("SELECT pg_catalog.setval('seq_phpgw_vfs', 4, true);");           
42    }
43   
44        // CREATE TABLE PHPGW_VFS_QUOTA
45        $oProc->query("CREATE TABLE phpgw_vfs_quota (directory VARCHAR(100), quota_size INT NOT NULL, PRIMARY KEY (directory));");
46       
47        // DELETE
48        $oProc->query("DELETE FROM phpgw_config WHERE config_app = 'filemanager';");
49        $oProc->query("DELETE FROM phpgw_preferences WHERE preference_app = 'filemanager';");
50       
51        // INSERT
52        $oProc->query("INSERT INTO phpgw_config VALUES ('filemanager','filemanager_quota_size',500);");
53        $oProc->query("INSERT INTO phpgw_config VALUES ('filemanager','filemanager_Max_file_size',20);");
54        $oProc->query('INSERT INTO phpgw_preferences VALUES (-2,\'filemanager\',\'a:19:{s:4:"name";s:1:"1";s:9:"mime_type";s:1:"1";s:4:"size";s:1:"1";s:7:"created";s:1:"1";s:8:"modified";s:1:"1";s:5:"owner";s:1:"1";s:12:"createdby_id";s:1:"1";s:13:"modifiedby_id";s:1:"1";s:3:"app";s:1:"0";s:7:"comment";s:1:"1";s:7:"version";s:1:"1";s:12:"viewinnewwin";s:1:"1";s:12:"viewonserver";s:1:"1";s:13:"viewtextplain";s:1:"1";s:6:"dotdot";s:1:"1";s:8:"dotfiles";s:1:"1";s:8:"pdf_type";s:8:"portrait";s:14:"pdf_paper_type";s:2:"a4";s:14:"files_per_page";s:3:"200";}\');');
55        $oProc->query("INSERT INTO phpgw_vfs (owner_id, createdby_id, modifiedby_id, created, modified, size, mime_type, deleteable, comment, app, directory, name, link_directory, link_name) VALUES (1,0,0,'1970-01-01',NULL,NULL,'Directory','Y',NULL,NULL,'/','', NULL, NULL);");
56        $oProc->query("INSERT INTO phpgw_vfs (owner_id, createdby_id, modifiedby_id, created, modified, size, mime_type, deleteable, comment, app, directory, name, link_directory, link_name) VALUES (2,0,0,'1970-01-01',NULL,NULL,'Directory','Y',NULL,NULL,'/','home', NULL, NULL);");
57
58?>
Note: See TracBrowser for help on using the repository browser.