Changeset 12676585ba100d724ee89e914e7a954fce69068a

Show
Ignore:
Timestamp:
03/17/07 13:57:53 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1174136273 +0100
git-parent:

[15188108f117a3325007e48c9a7e54c7a7e9c7c1]

git-author:
Christopher Jung <bktheg@web.de> 1174136273 +0100
Message:

FK-Constraint fuer battles_ships.shipid eingebaut

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • db/tables/battles_ships.sql

    r425acaa r1267658  
    11CREATE TABLE `battles_ships` ( 
    2   `shipid` mediumint(8) unsigned NOT NULL default '0', 
     2  `shipid` int(11) NOT NULL default '0', 
    33  `battleid` smallint(5) unsigned NOT NULL default '0', 
    44  `side` tinyint(3) unsigned NOT NULL default '0', 
     
    1515  KEY `battleid` (`battleid`) 
    1616) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Die Schiffsdaten in Schlachten';  
     17 
     18ALTER TABLE battles_ships ADD CONSTRAINT battles_ships_fk_ships FOREIGN KEY (shipid) REFERENCES ships(id); 
  • db/updates.xml

    r1518810 r1267658  
    163163                ALTER TABLE battles CHANGE id id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT; 
    164164                ALTER TABLE battles_ships ADD CONSTRAINT battles_ships_fk_battles FOREIGN KEY (battleid) REFERENCES battles(id); 
     165                ALTER TABLE battles_ships CHANGE shipid shipid INT NOT NULL DEFAULT '0'; 
     166                ALTER TABLE battles_ships ADD CONSTRAINT battles_ships_fk_ships FOREIGN KEY (shipid) REFERENCES ships(id); 
    165167        ]]></update> 
    166168</updates> 
  • src/net/driftingsouls/ds2/server/battles/Battle.java

    re43c7a3 r1267658  
    18741874                                dockcount--; 
    18751875                                 
     1876                                db.update("DELETE FROM battles_ships WHERE shipid=",aship.getInt("id")); 
     1877                                 
    18761878                                Ships.destroy( aship.getInt("id") ); 
    1877                                 db.update("DELETE FROM battles_ships WHERE shipid=",aship.getInt("id")); 
    18781879                        } 
    18791880