Converting SEDB60 to SEDB70

For bug reports and fixes, installation issues, and new ideas for technical features.

Moderator: SEOW Developers

Post Reply
IV/JG7_4Shades
Posts: 2201
Joined: Mon 08 Jan 2007 11:10 pm
Location: Perth, Western Australia

Converting SEDB60 to SEDB70

Post by IV/JG7_4Shades »

There are many new data and structural changes in SEDB70, so manually converting SEDB60 databases to SEDB70 standard is difficult and not recommended.

However you can convert the structures very easily using the MySQL DDL script below. This makes all the new tables and revises the appropriate existing table structures, and then fills in some reasonable default values for new columns.

Code: Select all

# New structure for AircraftLoadout
ALTER TABLE AircraftLoadout ADD COLUMN Rearm_Delay INT, ADD COLUMN Airbase_Supply_Req INT;
UPDATE AircraftLoadout SET Rearm_Delay=0, Airbase_Supply_Req=0;

# New structure for Army_Units
ALTER TABLE Army_Units ADD COLUMN Max_Platoons INT, ADD COLUMN Icon_Set VARCHAR(50);
UPDATE Army_Units SET Max_Platoons=64, Icon_Set='default';

# New structure for Campaign_Settings
ALTER TABLE Campaign_Settings ADD COLUMN Ground_Skill_Updates INT, ADD COLUMN Combat_Effectiveness INT, ADD COLUMN Freight_Radius INT, ADD COLUMN Delegation_Mode INT, ADD COLUMN Chief_Endpoints INT, ADD COLUMN Active_SPGs INT;
UPDATE Campaign_Settings SET Control_Radius = 100*Control_Radius;
UPDATE Campaign_Settings SET Ground_Skill_Updates=1, Combat_Effectiveness=1,Freight_Radius=Control_Radius,Delegation_Mode=1,Chief_Endpoints=0;

#New table Combat_Effectiveness
DROP TABLE IF EXISTS `Combat_Effectiveness_Model`;
CREATE TABLE `Combat_Effectiveness_Model` (
  `Allied_Supply_Weighting` double(11,8) NOT NULL,
  `Allied_Morale_Weighting` double(11,8) NOT NULL,
  `Allied_CCCI_Weighting` double(11,8) NOT NULL,
  `Allied_Skill_Weighting` double(11,8) NOT NULL,
  `Allied_Stamina_Weighting` double(11,8) NOT NULL,
  `Axis_Supply_Weighting` double(11,8) NOT NULL,
  `Axis_Morale_Weighting` double(11,8) NOT NULL,
  `Axis_CCCI_Weighting` double(11,8) NOT NULL,
  `Axis_Skill_Weighting` double(11,8) NOT NULL,
  `Axis_Stamina_Weighting` double(11,8) NOT NULL,
  `CF_Formation_Default` double(11,8) NOT NULL,
  `CF_Formation_A` double(11,8) NOT NULL,
  `CF_Formation_B` double(11,8) NOT NULL,
  `CF_Formation_C` double(11,8) NOT NULL,
  `CF_Formation_D` double(11,8) NOT NULL,
  `CF_Formation_E` double(11,8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `Combat_Effectiveness_Model` VALUES ('0.50000000', '1.00000000', '1.00000000', '1.00000000', '1.00000000', '0.50000000', '1.00000000', '1.00000000', '1.00000000', '1.00000000', '0.50000000', '0.90000000', '0.80000000', '1.00000000', '1.00000000', '1.00000000');

#New table Exclusion_Zones
DROP TABLE IF EXISTS `Exclusion_Zones`;
CREATE TABLE `Exclusion_Zones` (
  `Map` varchar(255) NOT NULL,
  `Name` varchar(255) NOT NULL,
  `TL_X` double(11,0) NOT NULL,
  `TL_Y` double(11,0) NOT NULL,
  `BR_X` double(11,0) NOT NULL,
  `BR_Y` double(11,0) NOT NULL,
  `Excluded_Allied` int(255) NOT NULL,
  `Excluded_Axis` int(255) NOT NULL,
  `Excluded_Air` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


# New structure for Object_Specifications
ALTER TABLE Object_Specifications ADD COLUMN Air_Observer INT AFTER Tailhook, ADD COLUMN Barrage_Resistant INT AFTER Air_Observer;
UPDATE Object_Specifications SET Air_Observer=0, Barrage_Resistant=0;

# New structure for ObjMissionData
ALTER TABLE ObjMissionData ADD COLUMN Formation VARCHAR(25)  AFTER Recon_Percent;
UPDATE ObjMissionData SET Formation='default';

#New table Pilot_Photos
DROP TABLE IF EXISTS `Pilot_Photos`;
CREATE TABLE `Pilot_Photos` (
  `Pilot_Name` varchar(255) DEFAULT NULL,
  `Photo_Name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

# New structure for Resupply_Points
ALTER TABLE Resupply_Points ADD COLUMN Reliability INT;
UPDATE Resupply_Points SET Reliability=100;

#New structure for Resupply_Points
ALTER TABLE Resupply_Replacements ADD COLUMN Transit_Probability INT;
UPDATE Resupply_Replacements SET Transit_Probability=100;

#New table Sector_Coordinates
DROP TABLE IF EXISTS `Sector_Coordinates`;
CREATE TABLE `Sector_Coordinates` (
  `Map` varchar(255) DEFAULT NULL,
  `Xmin` double(11,0) DEFAULT NULL,
  `Ymin` double(11,0) DEFAULT NULL,
  `Xmax` double(11,0) DEFAULT NULL,
  `Ymax` double(11,0) DEFAULT NULL,
  `First_Column_Label` varchar(255) DEFAULT NULL,
  `First_Row_Label` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `Sector_Coordinates` VALUES ('Africa_NE', '0', '0', '944000', '307200', 'AA', '1'), ('Africa_NW', '0', '0', '600000', '299200', 'AA', '1'), ('Aleutians', '0', '0', '608000', '262400', 'AA', '1'), ('Ardennes', '0', '0', '60000', '40000', 'A', '1'), ('Balaton', '0', '0', '192000', '166400', 'A', '1'), ('Barents Sea', '0', '0', '307200', '403200', 'AA', '1'), ('Battle of Moscow', '0', '0', '460800', '371200', 'AA', '1'), ('Bay of Biscay', '0', '0', '352000', '460800', 'AA', '1'), ('Berlin', '0', '0', '195200', '83200', 'A', '1'), ('Borneo', '0', '0', '608000', '408000', 'AA', '1'), ('Burma', '0', '0', '600000', '598400', 'AA', '1'), ('Cartagena', '0', '0', '70400', '70400', 'A', '1'), ('Central Med', '0', '0', '484800', '243200', 'AA', '1'), ('Channel 1940', '0', '0', '174400', '139200', 'A', '1'), ('Channel 1942', '0', '0', '174400', '139200', 'A', '1'), ('Coral Sea', '-990000', '-990000', '10000', '10000', 'AA', '1'), ('Crete', '0', '0', '478400', '222400', 'AA', '1'), ('Crimea', '0', '0', '294400', '166400', 'AA', '1'), ('Cyrenaica', '0', '0', '84800', '64000', 'A', '1'), ('Darwin', '0', '0', '104000', '160000', 'A', '1'), ('Donbass', '0', '0', '326500', '403000', 'AA', '1'), ('El Alamein', '0', '0', '326500', '281600', 'AA', '1'), ('English Channel', '0', '0', '174000', '139500', 'A', '1'), ('Fortress Malta', '0', '0', '147000', '243000', 'A', '1'), ('Gothic Line', '0', '0', '224000', '135000', 'A', '1'), ('Guadalcanal', '-339000', '-380000', '161300', '120000', 'AA', '-3'), ('Gulf of Finland', '0', '0', '434800', '214000', 'AA', '1'), ('Hawaii', '-600000', '-50000', '400000', '950000', 'AA', '56'), ('Iasi', '0', '0', '150000', '291000', 'AA', '13'), ('Imphal', '0', '0', '140000', '100000', 'A', '1'), ('Italy', '0', '0', '160000', '160000', 'A', '1'), ('Italy_Africa_Greece', '0', '0', '307000', '260000', 'AA', '1'), ('Italy_Greece', '40000', '90000', '307000', '260000', 'AE', '10'), ('Iwo Jima', '-600000', '-600000', '200000', '200000', 'AA', '1'), ('Khalkhin Gol', '0', '0', '41500', '41500', 'A', '1'), ('Khalkhin Gol Exp', '0', '0', '136000', '128000', 'A', '1'), ('Kiev', '0', '0', '288000', '201000', 'AA', '1'), ('Kiev_AP', '0', '0', '288000', '201000', 'AA', '1'), ('Korea', '0', '0', '575000', '530000', 'AA', '1'), ('Kuban', '0', '0', '222000', '195000', 'A', '1'), ('Kurland', '0', '0', '245000', '320000', 'A', '1'), ('Kursk', '0', '0', '191000', '166000', 'A', '1'), ('Kyushu', '0', '0', '295000', '330000', 'AA', '1'), ('Libya', '0', '0', '306500', '255200', 'AA', '1'), ('Lvov', '0', '0', '176000', '153000', 'A', '1'), ('Malta', '0', '0', '100000', '94000', 'A', '1'), ('Manchuria', '0', '0', '255400', '409000', 'AA', '1'), ('Marianas', '-300000', '-100000', '700000', '600000', 'AA', '21'), ('Mediterranean', '0', '0', '307000', '260000', 'AA', '21'), ('Midway', '-179200', '0', '320000', '400000', 'AA', '19'), ('Midway Large', '-179200', '-225000', '420000', '375000', 'AA', '-2'), ('Moscow', '0', '0', '192000', '170000', 'A', '1'), ('Murmansk', '0', '0', '307000', '260000', 'AA', '1'), ('New Guinea', '0', '0', '435000', '243000', 'AA', '1'), ('Normandy', '0', '0', '153500', '102000', 'A', '1'), ('North Sea', '0', '0', '141000', '141000', 'A', '1'), ('Odessa', '200000', '60000', '350000', '291000', 'AU', '7'), ('Okinawa', '-15000', '-15000', '285000', '285000', 'AA', '1'), ('Oslo', '0', '0', '51500', '51500', 'A', '1'), ('Ostfriesland', '0', '0', '103800', '80000', 'A', '1'), ('Palau', '-200000', '-200000', '300000', '300000', 'AA', '1'), ('Palembang', '0', '0', '474000', '422500', 'AA', '1'), ('Philippines', '0', '0', '720000', '720000', 'AA', '1'), ('Prokhorovka', '0', '0', '108500', '95500', 'A', '1'), ('Santa Cruz', '0', '0', '400000', '400000', 'AA', '1'), ('Sardegna', '0', '0', '102300', '102300', 'A', '1'), ('Sinai', '0', '0', '225000', '307300', 'A', '1'), ('Singapore', '0', '0', '400000', '270000', 'AA', '1'), ('Slovakia', '0', '0', '224000', '135000', 'A', '1'), ('Slovenia', '0', '0', '307000', '255500', 'AA', '1'), ('Smolensk', '0', '0', '192000', '166200', 'A', '1'), ('Stalingrad', '0', '0', '192000', '166200', 'A', '1'), ('Stalingrad Winter', '0', '0', '192000', '166200', 'A', '1'), ('Tarawa', '-500000', '-500000', '500000', '500000', 'AA', '1'), ('Thailand', '0', '0', '600000', '740000', 'AA', '1'), ('The Slot Aug 42', '0', '0', '825000', '600000', 'AA', '1'), ('The Slot Dec 42', '0', '0', '825000', '600000', 'AA', '1'), ('The Slot Jan 44', '0', '0', '825000', '600000', 'AA', '1'), ('The Slot Jul 43', '0', '0', '825000', '600000', 'AA', '1'), ('The Slot Oct 42', '0', '0', '825000', '600000', 'AA', '1'), ('The Slot Oct 43', '0', '0', '825000', '600000', 'AA', '1'), ('Tubruq', '0', '0', '204500', '204500', 'A', '1'), ('Tunis', '0', '0', '51200', '51200', 'A', '1'), ('West Front 44', '0', '0', '432000', '334200', 'AA', '1'), ('Western Carolines', '-180000', '-90000', '520000', '310000', 'AA', '10');
What this script DOES NOT do is update all the changed data in the important tables. The important tables for data changes are:

Airbases
Airbase_Layouts
AircraftLoadout
AirforceUnits
Convoys_Vehicles
Highways
Highway_Intersections
Object_Costs
Object_Specifications
Radar_Maps
Railway_Waypoints
Railway_Intersections
Railway_Stations
Resupply_Points
Rocket_Parameters
Sector_*
Tile_Map_Codes

The tables listed above in dark red are sector-specific, so only need to be changed if you are converting a SEDB60 database for use with a sector map new to SEOW7, or if you are converting an SEDB60 to be used as a default DB connection for the MP (it needs to have data for all sectors). Bay of Biscay users may need to update Airbases tables regardless.

Cheers,
4S
IV/JG7_4Shades
SEOW Developer

Image
Post Reply