Split migrations for RegionStore and EstateStore (see WARNING!)

ok, so the estate stores now want their own migration files, but as it
happened the SQL definition were inside the Region migrations.
It seems better/cleaner to keep each 'store' separately updatable.

WARNING: any editing in the middle of the migration scripts (as opposite
to just appending to them) has the potential of messing up updates of
existing databases.  As far as I can see, this one is (probably) safe,
the worst that could happen is the EstateStore migration silently fail
if the estate the tables are already there.
soprefactor
AlexRa 2010-05-17 17:37:16 +02:00
parent 724305c37b
commit ebc2b6d4f6
4 changed files with 157 additions and 103 deletions

View File

@ -0,0 +1,69 @@
:VERSION 13
# The estate migrations used to be in Region store
CREATE TABLE IF NOT EXISTS `estate_managers` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `estate_groups` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `estate_users` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `estateban` (
`EstateID` int(10) unsigned NOT NULL,
`bannedUUID` varchar(36) NOT NULL,
`bannedIp` varchar(16) NOT NULL,
`bannedIpHostMask` varchar(16) NOT NULL,
`bannedNameMask` varchar(64) default NULL,
KEY `estateban_EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `estate_settings` (
`EstateID` int(10) unsigned NOT NULL auto_increment,
`EstateName` varchar(64) default NULL,
`AbuseEmailToEstateOwner` tinyint(4) NOT NULL,
`DenyAnonymous` tinyint(4) NOT NULL,
`ResetHomeOnTeleport` tinyint(4) NOT NULL,
`FixedSun` tinyint(4) NOT NULL,
`DenyTransacted` tinyint(4) NOT NULL,
`BlockDwell` tinyint(4) NOT NULL,
`DenyIdentified` tinyint(4) NOT NULL,
`AllowVoice` tinyint(4) NOT NULL,
`UseGlobalTime` tinyint(4) NOT NULL,
`PricePerMeter` int(11) NOT NULL,
`TaxFree` tinyint(4) NOT NULL,
`AllowDirectTeleport` tinyint(4) NOT NULL,
`RedirectGridX` int(11) NOT NULL,
`RedirectGridY` int(11) NOT NULL,
`ParentEstateID` int(10) unsigned NOT NULL,
`SunPosition` double NOT NULL,
`EstateSkipScripts` tinyint(4) NOT NULL,
`BillableFactor` float NOT NULL,
`PublicAccess` tinyint(4) NOT NULL,
`AbuseEmail` varchar(255) not null,
`EstateOwner` varchar(36) not null,
`DenyMinors` tinyint not null,
PRIMARY KEY (`EstateID`)
) ENGINE=InnoDB AUTO_INCREMENT=100;
CREATE TABLE IF NOT EXISTS `estate_map` (
`RegionID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
`EstateID` int(11) NOT NULL,
PRIMARY KEY (`RegionID`),
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;

View File

@ -386,84 +386,6 @@ CREATE TABLE `regionsettings` (
PRIMARY KEY (`regionUUID`)
) ENGINE=InnoDB;
CREATE TABLE `estate_managers` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE `estate_groups` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE `estate_users` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE `estateban` (
`EstateID` int(10) unsigned NOT NULL,
`bannedUUID` varchar(36) NOT NULL,
`bannedIp` varchar(16) NOT NULL,
`bannedIpHostMask` varchar(16) NOT NULL,
`bannedNameMask` varchar(64) default NULL,
KEY `estateban_EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE `estate_settings` (
`EstateID` int(10) unsigned NOT NULL auto_increment,
`EstateName` varchar(64) default NULL,
`AbuseEmailToEstateOwner` tinyint(4) NOT NULL,
`DenyAnonymous` tinyint(4) NOT NULL,
`ResetHomeOnTeleport` tinyint(4) NOT NULL,
`FixedSun` tinyint(4) NOT NULL,
`DenyTransacted` tinyint(4) NOT NULL,
`BlockDwell` tinyint(4) NOT NULL,
`DenyIdentified` tinyint(4) NOT NULL,
`AllowVoice` tinyint(4) NOT NULL,
`UseGlobalTime` tinyint(4) NOT NULL,
`PricePerMeter` int(11) NOT NULL,
`TaxFree` tinyint(4) NOT NULL,
`AllowDirectTeleport` tinyint(4) NOT NULL,
`RedirectGridX` int(11) NOT NULL,
`RedirectGridY` int(11) NOT NULL,
`ParentEstateID` int(10) unsigned NOT NULL,
`SunPosition` double NOT NULL,
`EstateSkipScripts` tinyint(4) NOT NULL,
`BillableFactor` float NOT NULL,
`PublicAccess` tinyint(4) NOT NULL,
PRIMARY KEY (`EstateID`)
) ENGINE=InnoDB AUTO_INCREMENT=100;
CREATE TABLE `estate_map` (
`RegionID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
`EstateID` int(11) NOT NULL,
PRIMARY KEY (`RegionID`),
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
commit;
:VERSION 14 #---------------------
begin;
alter table estate_settings add column AbuseEmail varchar(255) not null;
alter table estate_settings add column EstateOwner varchar(36) not null;
commit;
:VERSION 15 #---------------------
begin;
alter table estate_settings add column DenyMinors tinyint not null;
commit;
:VERSION 16 #---------------------

View File

@ -0,0 +1,88 @@
:VERSION 6
BEGIN TRANSACTION;
CREATE TABLE estate_groups (
EstateID int(10) NOT NULL,
uuid char(36) NOT NULL
);
CREATE TABLE estate_managers (
EstateID int(10) NOT NULL,
uuid char(36) NOT NULL
);
CREATE TABLE estate_map (
RegionID char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
EstateID int(11) NOT NULL
);
CREATE TABLE estate_settings (
EstateID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
EstateName varchar(64) default NULL,
AbuseEmailToEstateOwner tinyint(4) NOT NULL,
DenyAnonymous tinyint(4) NOT NULL,
ResetHomeOnTeleport tinyint(4) NOT NULL,
FixedSun tinyint(4) NOT NULL,
DenyTransacted tinyint(4) NOT NULL,
BlockDwell tinyint(4) NOT NULL,
DenyIdentified tinyint(4) NOT NULL,
AllowVoice tinyint(4) NOT NULL,
UseGlobalTime tinyint(4) NOT NULL,
PricePerMeter int(11) NOT NULL,
TaxFree tinyint(4) NOT NULL,
AllowDirectTeleport tinyint(4) NOT NULL,
RedirectGridX int(11) NOT NULL,
RedirectGridY int(11) NOT NULL,
ParentEstateID int(10) NOT NULL,
SunPosition double NOT NULL,
EstateSkipScripts tinyint(4) NOT NULL,
BillableFactor float NOT NULL,
PublicAccess tinyint(4) NOT NULL
);
insert into estate_settings (
EstateID,EstateName,AbuseEmailToEstateOwner,DenyAnonymous,ResetHomeOnTeleport,FixedSun,DenyTransacted,BlockDwell,DenyIdentified,AllowVoice,UseGlobalTime,PricePerMeter,TaxFree,AllowDirectTeleport,RedirectGridX,RedirectGridY,ParentEstateID,SunPosition,PublicAccess,EstateSkipScripts,BillableFactor)
values ( 99, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
delete from estate_settings;
CREATE TABLE estate_users (
EstateID int(10) NOT NULL,
uuid char(36) NOT NULL
);
CREATE TABLE estateban (
EstateID int(10) NOT NULL,
bannedUUID varchar(36) NOT NULL,
bannedIp varchar(16) NOT NULL,
bannedIpHostMask varchar(16) NOT NULL,
bannedNameMask varchar(64) default NULL
);
CREATE INDEX estate_ban_estate_id on estateban(EstateID);
CREATE INDEX estate_groups_estate_id on estate_groups(EstateID);
CREATE INDEX estate_managers_estate_id on estate_managers(EstateID);
CREATE INDEX estate_map_estate_id on estate_map(EstateID);
CREATE UNIQUE INDEX estate_map_region_id on estate_map(RegionID);
CREATE INDEX estate_users_estate_id on estate_users(EstateID);
COMMIT;
:VERSION 7
begin;
alter table estate_settings add column AbuseEmail varchar(255) not null default '';
alter table estate_settings add column EstateOwner varchar(36) not null default '';
commit;
:VERSION 8
begin;
alter table estate_settings add column DenyMinors tinyint not null default 0;
commit;

View File

@ -311,33 +311,8 @@ CREATE TABLE regionsettings (
PRIMARY KEY (regionUUID)
);
CREATE INDEX estate_ban_estate_id on estateban(EstateID);
CREATE INDEX estate_groups_estate_id on estate_groups(EstateID);
CREATE INDEX estate_managers_estate_id on estate_managers(EstateID);
CREATE INDEX estate_map_estate_id on estate_map(EstateID);
CREATE UNIQUE INDEX estate_map_region_id on estate_map(RegionID);
CREATE INDEX estate_users_estate_id on estate_users(EstateID);
COMMIT;
:VERSION 7
begin;
alter table estate_settings add column AbuseEmail varchar(255) not null default '';
alter table estate_settings add column EstateOwner varchar(36) not null default '';
commit;
:VERSION 8
begin;
alter table estate_settings add column DenyMinors tinyint not null default 0;
commit;
:VERSION 9
BEGIN;