source: extensions/UserCollections/include/install.inc.php @ 19274

Last change on this file since 19274 was 17657, checked in by mistic100, 12 years ago

consolidate upgrade process, remote filter_var function (PHP 5.2)

File size: 862 bytes
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4function user_collections_install() 
5{
6  global $conf, $prefixeTable;
7 
8  // create tables
9  $query = '
10CREATE TABLE IF NOT EXISTS `'.$prefixeTable.'collections` (
11  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
12  `user_id` smallint(5) DEFAULT NULL,
13  `name` varchar(255) NOT NULL,
14  `date_creation` datetime NOT NULL,
15  `nb_images` mediumint(8) NOT NULL DEFAULT 0,
16  `active` tinyint(1) DEFAULT 0,
17  `public` tinyint(1) DEFAULT 0,
18  `public_id` varchar(10) NULL,
19  PRIMARY KEY (`id`)
20) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1
21;';
22  pwg_query($query);
23 
24  $query = '
25CREATE TABLE IF NOT EXISTS `'.$prefixeTable.'collection_images` (
26  `col_id` mediumint(8) NOT NULL,
27  `image_id` mediumint(8) NOT NULL,
28  UNIQUE KEY `UNIQUE` (`col_id`,`image_id`)
29) DEFAULT CHARSET=utf8
30;';
31  pwg_query($query);
32}
33
34?>
Note: See TracBrowser for help on using the repository browser.