From 532787d4d1d0b59d9610f76276c2fd65fa039fb5 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 15 Mar 2013 01:05:46 +1000 Subject: Add the SQL update scripts. --- sql/groups.sql | 111 ++++++++++++++++++++++++++ sql/offline.sql | 5 ++ sql/osprofile.sql | 68 ++++++++++++++++ sql/ossearch-migrations.sql | 36 +++++++++ sql/ossearch.sql | 187 ++++++++++++++++++++++++++++++++++++++++++++ sql/update-usernotes.sql | 3 + sql/update-userprofile.sql | 2 + 7 files changed, 412 insertions(+) create mode 100644 sql/groups.sql create mode 100644 sql/offline.sql create mode 100644 sql/osprofile.sql create mode 100644 sql/ossearch-migrations.sql create mode 100644 sql/ossearch.sql create mode 100644 sql/update-usernotes.sql create mode 100644 sql/update-userprofile.sql (limited to 'sql') diff --git a/sql/groups.sql b/sql/groups.sql new file mode 100644 index 0000000..1815203 --- /dev/null +++ b/sql/groups.sql @@ -0,0 +1,111 @@ +-- +-- Table structure for table `osagent` +-- + +CREATE TABLE `osagent` ( + `AgentID` char(36) NOT NULL default '', + `ActiveGroupID` char(36) NOT NULL default '', + PRIMARY KEY (`AgentID`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `osgroup` +-- + +CREATE TABLE `osgroup` ( + `GroupID` char(36) NOT NULL default '', + `Name` varchar(255) NOT NULL default '', + `Charter` text NOT NULL, + `InsigniaID` char(36) NOT NULL default '', + `FounderID` char(36) NOT NULL default '', + `MembershipFee` int(11) NOT NULL default '0', + `OpenEnrollment` varchar(255) NOT NULL default '', + `ShowInList` tinyint(1) NOT NULL default '0', + `AllowPublish` tinyint(1) NOT NULL default '0', + `MaturePublish` tinyint(1) NOT NULL default '0', + `OwnerRoleID` char(36) NOT NULL default '', + PRIMARY KEY (`GroupID`), + UNIQUE KEY `Name` (`Name`), + FULLTEXT KEY `Name_2` (`Name`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `osgroupinvite` +-- + +CREATE TABLE `osgroupinvite` ( + `InviteID` char(36) NOT NULL default '', + `GroupID` char(36) NOT NULL default '', + `RoleID` char(36) NOT NULL default '', + `AgentID` char(36) NOT NULL default '', + `TMStamp` timestamp NOT NULL, + PRIMARY KEY (`InviteID`), + UNIQUE KEY `GroupID` (`GroupID`,`RoleID`,`AgentID`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `osgroupmembership` +-- + +CREATE TABLE `osgroupmembership` ( + `GroupID`char(36) NOT NULL default '', + `AgentID` char(36) NOT NULL default '', + `SelectedRoleID` char(36) NOT NULL default '', + `Contribution` int(11) NOT NULL default '0', + `ListInProfile` int(11) NOT NULL default '1', + `AcceptNotices` int(11) NOT NULL default '1', + PRIMARY KEY (`GroupID`,`AgentID`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `osgroupnotice` +-- + +CREATE TABLE `osgroupnotice` ( + `GroupID` char(36) NOT NULL default '', + `NoticeID` char(36) NOT NULL default '', + `Timestamp` int(10) unsigned NOT NULL default '0', + `FromName` varchar(255) NOT NULL default '', + `Subject` varchar(255) NOT NULL default '', + `Message` text NOT NULL, + `BinaryBucket` text NOT NULL, + PRIMARY KEY (`GroupID`,`NoticeID`), + KEY `Timestamp` (`Timestamp`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `osgrouprolemembership` +-- + +CREATE TABLE `osgrouprolemembership` ( + `GroupID` char(36) NOT NULL default '', + `RoleID` char(36) NOT NULL default '', + `AgentID` char(36) NOT NULL default '', + PRIMARY KEY (`GroupID`,`RoleID`,`AgentID`) +) ENGINE=MyISAM; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `osrole` +-- + +CREATE TABLE `osrole` ( + `GroupID` char(36) NOT NULL default '', + `RoleID` char(36) NOT NULL default '', + `Name` varchar(255) NOT NULL default '', + `Description` varchar(255) NOT NULL default '', + `Title` varchar(255) NOT NULL default '', + `Powers` bigint(20) unsigned NOT NULL default '0', + PRIMARY KEY (`GroupID`,`RoleID`) +) ENGINE=MyISAM; diff --git a/sql/offline.sql b/sql/offline.sql new file mode 100644 index 0000000..2959b54 --- /dev/null +++ b/sql/offline.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS `Offline_IM` ( + `uuid` varchar(36) NOT NULL, + `message` text NOT NULL, + PRIMARY KEY (`uuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; diff --git a/sql/osprofile.sql b/sql/osprofile.sql new file mode 100644 index 0000000..bcd5be0 --- /dev/null +++ b/sql/osprofile.sql @@ -0,0 +1,68 @@ +CREATE TABLE IF NOT EXISTS `classifieds` ( + `classifieduuid` char(36) NOT NULL, + `creatoruuid` char(36) NOT NULL, + `creationdate` int(20) NOT NULL, + `expirationdate` int(20) NOT NULL, + `category` varchar(20) NOT NULL, + `name` varchar(255) NOT NULL, + `description` text NOT NULL, + `parceluuid` char(36) NOT NULL, + `parentestate` int(11) NOT NULL, + `snapshotuuid` char(36) NOT NULL, + `simname` varchar(255) NOT NULL, + `posglobal` varchar(255) NOT NULL, + `parcelname` varchar(255) NOT NULL, + `classifiedflags` int(8) NOT NULL, + `priceforlisting` int(5) NOT NULL, + PRIMARY KEY (`classifieduuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE IF NOT EXISTS `usernotes` ( + `useruuid` varchar(36) NOT NULL, + `targetuuid` varchar(36) NOT NULL, + `notes` text NOT NULL, + UNIQUE KEY `useruuid` (`useruuid`,`targetuuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE IF NOT EXISTS `userpicks` ( + `pickuuid` varchar(36) NOT NULL, + `creatoruuid` varchar(36) NOT NULL, + `toppick` enum('true','false') NOT NULL, + `parceluuid` varchar(36) NOT NULL, + `name` varchar(255) NOT NULL, + `description` text NOT NULL, + `snapshotuuid` varchar(36) NOT NULL, + `user` varchar(255) NOT NULL, + `originalname` varchar(255) NOT NULL, + `simname` varchar(255) NOT NULL, + `posglobal` varchar(255) NOT NULL, + `sortorder` int(2) NOT NULL, + `enabled` enum('true','false') NOT NULL, + PRIMARY KEY (`pickuuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE IF NOT EXISTS `userprofile` ( + `useruuid` varchar(36) NOT NULL, + `profilePartner` varchar(36) NOT NULL, + `profileAllowPublish` binary(1) NOT NULL, + `profileMaturePublish` binary(1) NOT NULL, + `profileURL` varchar(255) NOT NULL, + `profileWantToMask` int(3) NOT NULL, + `profileWantToText` text NOT NULL, + `profileSkillsMask` int(3) NOT NULL, + `profileSkillsText` text NOT NULL, + `profileLanguages` text NOT NULL, + `profileImage` varchar(36) NOT NULL, + `profileAboutText` text NOT NULL, + `profileFirstImage` varchar(36) NOT NULL, + `profileFirstText` text NOT NULL, + PRIMARY KEY (`useruuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE IF NOT EXISTS `usersettings` ( + `useruuid` varchar(36) NOT NULL, + `imviaemail` enum('true','false') NOT NULL, + `visible` enum('true','false') NOT NULL, + `email` varchar(254) NOT NULL, + PRIMARY KEY (`useruuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; diff --git a/sql/ossearch-migrations.sql b/sql/ossearch-migrations.sql new file mode 100644 index 0000000..65b4cad --- /dev/null +++ b/sql/ossearch-migrations.sql @@ -0,0 +1,36 @@ +#This file updates the tables used by OpenSimSearch to the latest schema. +#Use this file if you are updating an existing installation of the search +#module. If you are doing a first time install, use the ossearch.sql file. + +#SVN revision 126 +BEGIN; +ALTER TABLE `parcelsales` CHANGE `mature` `mature` varchar(32) NOT NULL DEFAULT 'PG'; +COMMIT; + +#SVN revision 142 +BEGIN; +ALTER TABLE `hostsregister` DROP `lastcheck`; +ALTER TABLE `hostsregister` ADD `nextcheck` int(10) NOT NULL AFTER `register`; +ALTER TABLE `hostsregister` ADD `checked` tinyint(1) NOT NULL AFTER `nextcheck`; +ALTER TABLE `hostsregister` CHANGE `failcounter` `failcounter` int(10) NOT NULL; +COMMIT; + +#SVN revision 149 +BEGIN; +ALTER TABLE `events` DROP `mature`; +ALTER TABLE `events` CHANGE `eventflags` `eventflags` tinyint(1) NOT NULL; +ALTER TABLE `parcels` ADD `mature` VARCHAR( 10 ) NOT NULL; +ALTER TABLE `parcelsales` CHANGE `mature` `mature` VARCHAR( 10 ) NOT NULL DEFAULT 'PG'; +ALTER TABLE `popularplaces` CHANGE `has_picture` `has_picture` tinyint(1) NOT NULL; +COMMIT; + +#SVN revision 153 +BEGIN; +ALTER TABLE `parcels` CHANGE `mature` `mature` VARCHAR( 10 ) NOT NULL DEFAULT 'PG'; +COMMIT; + +#SVN revision 154 +BEGIN; +ALTER TABLE `events` CHANGE `dateUTC` `dateUTC` int(10) NOT NULL; +ALTER TABLE `events` CHANGE `covercharge` `covercharge` tinyint(1) NOT NULL; +COMMIT; diff --git a/sql/ossearch.sql b/sql/ossearch.sql new file mode 100644 index 0000000..a1ef08f --- /dev/null +++ b/sql/ossearch.sql @@ -0,0 +1,187 @@ +-- phpMyAdmin SQL Dump +-- version 2.7.0-beta1 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generatie Tijd: 24 Jan 2009 om 15:48 +-- Server versie: 5.0.67 +-- PHP Versie: 5.2.6-2ubuntu5 +-- +-- Database: `ossearch` +-- + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `allparcels` +-- + +CREATE TABLE `allparcels` ( + `regionUUID` varchar(255) NOT NULL, + `parcelname` varchar(255) NOT NULL, + `ownerUUID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000', + `groupUUID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000', + `landingpoint` varchar(255) NOT NULL, + `parcelUUID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000', + `infoUUID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000', + `parcelarea` int(11) NOT NULL, + PRIMARY KEY (`parcelUUID`), + KEY `regionUUID` (`regionUUID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `classifieds` +-- + +CREATE TABLE `classifieds` ( + `classifieduuid` char(36) NOT NULL, + `creatoruuid` char(36) NOT NULL, + `creationdate` int(20) NOT NULL, + `expirationdate` int(20) NOT NULL, + `category` varchar(20) NOT NULL, + `name` varchar(255) NOT NULL, + `description` text NOT NULL, + `parceluuid` char(36) NOT NULL, + `parentestate` int(11) NOT NULL, + `snapshotuuid` char(36) NOT NULL, + `simname` varchar(255) NOT NULL, + `posglobal` varchar(255) NOT NULL, + `parcelname` varchar(255) NOT NULL, + `classifiedflags` int(8) NOT NULL, + `priceforlisting` int(5) NOT NULL, + PRIMARY KEY (`classifieduuid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `events` +-- + +CREATE TABLE `events` ( + `owneruuid` char(40) NOT NULL, + `name` varchar(255) NOT NULL, + `eventid` int(11) NOT NULL auto_increment, + `creatoruuid` char(40) NOT NULL, + `category` int(2) NOT NULL, + `description` text NOT NULL, + `dateUTC` int(10) NOT NULL, + `duration` int(3) NOT NULL, + `covercharge` tinyint(1) NOT NULL, + `coveramount` int(10) NOT NULL, + `simname` varchar(255) NOT NULL, + `globalPos` varchar(255) NOT NULL, + `eventflags` int(1) NOT NULL, + PRIMARY KEY (`eventid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `hostsregister` +-- + +CREATE TABLE `hostsregister` ( + `host` varchar(255) NOT NULL, + `port` int(5) NOT NULL, + `register` int(10) NOT NULL, + `nextcheck` int(10) NOT NULL, + `checked` tinyint(1) NOT NULL, + `failcounter` int(10) NOT NULL, + PRIMARY KEY (`host`,`port`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `objects` +-- + +CREATE TABLE `objects` ( + `objectuuid` varchar(255) NOT NULL, + `parceluuid` varchar(255) NOT NULL, + `location` varchar(255) NOT NULL, + `name` varchar(255) NOT NULL, + `description` varchar(255) NOT NULL, + `regionuuid` varchar(255) NOT NULL default '', + PRIMARY KEY (`objectuuid`,`parceluuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `parcels` +-- + +CREATE TABLE `parcels` ( + `regionUUID` varchar(255) NOT NULL, + `parcelname` varchar(255) NOT NULL, + `parcelUUID` varchar(255) NOT NULL, + `landingpoint` varchar(255) NOT NULL, + `description` varchar(255) NOT NULL, + `searchcategory` varchar(50) NOT NULL, + `build` enum('true','false') NOT NULL, + `script` enum('true','false') NOT NULL, + `public` enum('true','false') NOT NULL, + `dwell` float NOT NULL default '0', + `infouuid` varchar(255) NOT NULL default '', + `mature` varchar(10) NOT NULL default 'PG', + PRIMARY KEY (`regionUUID`,`parcelUUID`), + KEY `name` (`parcelname`), + KEY `description` (`description`), + KEY `searchcategory` (`searchcategory`), + KEY `dwell` (`dwell`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `parcelsales` +-- + +CREATE TABLE `parcelsales` ( + `regionUUID` varchar(255) NOT NULL, + `parcelname` varchar(255) NOT NULL, + `parcelUUID` varchar(255) NOT NULL, + `area` int(6) NOT NULL, + `saleprice` int(11) NOT NULL, + `landingpoint` varchar(255) NOT NULL, + `infoUUID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000', + `dwell` int(11) NOT NULL, + `parentestate` int(11) NOT NULL default '1', + `mature` varchar(10) NOT NULL default 'PG', + PRIMARY KEY (`regionUUID`,`parcelUUID`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `popularplaces` +-- + +CREATE TABLE `popularplaces` ( + `parcelUUID` char(36) NOT NULL, + `name` varchar(255) NOT NULL, + `dwell` float NOT NULL, + `infoUUID` char(36) NOT NULL, + `has_picture` tinyint(1) NOT NULL, + `mature` tinyint(4) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Tabel structuur voor tabel `regions` +-- + +CREATE TABLE `osregions` ( + `regionname` varchar(255) NOT NULL, + `regionuuid` varchar(255) NOT NULL, + `regionhandle` varchar(255) NOT NULL, + `url` varchar(255) NOT NULL, + `owner` varchar(255) NOT NULL, + `owneruuid` varchar(255) NOT NULL, + PRIMARY KEY (`regionuuid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; diff --git a/sql/update-usernotes.sql b/sql/update-usernotes.sql new file mode 100644 index 0000000..e4538d9 --- /dev/null +++ b/sql/update-usernotes.sql @@ -0,0 +1,3 @@ +ALTER TABLE `usernotes` DROP PRIMARY KEY ; +ALTER TABLE `usernotes` ADD UNIQUE ( `useruuid` , `targetuuid` ); + diff --git a/sql/update-userprofile.sql b/sql/update-userprofile.sql new file mode 100644 index 0000000..1cbe1c2 --- /dev/null +++ b/sql/update-userprofile.sql @@ -0,0 +1,2 @@ +ALTER TABLE `userprofile` ADD `profileImage` VARCHAR( 36 ) NOT NULL AFTER `profileLanguages`, +ADD `profileAboutText` TEXT NOT NULL AFTER `profileImage` ; -- cgit v1.1