Discussion:Proposer des courses : Différence entre versions
Ligne 8 : | Ligne 8 : | ||
<nowiki> | <nowiki> | ||
CREATE TABLE `races` ( | CREATE TABLE `races` ( | ||
+ | |||
`idraces` int(11) NOT NULL auto_increment, | `idraces` int(11) NOT NULL auto_increment, | ||
+ | |||
`racename` varchar(255) NOT NULL default '', | `racename` varchar(255) NOT NULL default '', | ||
+ | |||
`started` int(11) NOT NULL default '0', | `started` int(11) NOT NULL default '0', | ||
+ | |||
`deptime` bigint(14) default NULL, | `deptime` bigint(14) default NULL, | ||
+ | |||
`startlong` int(11) NOT NULL default '0', | `startlong` int(11) NOT NULL default '0', | ||
+ | |||
`startlat` int(11) NOT NULL default '0', | `startlat` int(11) NOT NULL default '0', | ||
+ | |||
`boattype` varchar(255) default NULL, | `boattype` varchar(255) default NULL, | ||
+ | |||
`closetime` bigint(20) default NULL, | `closetime` bigint(20) default NULL, | ||
+ | |||
`racetype` int(11) default NULL, | `racetype` int(11) default NULL, | ||
+ | |||
`firstpcttime` bigint(20) default NULL, | `firstpcttime` bigint(20) default NULL, | ||
+ | |||
`depend_on` int(11) default NULL, | `depend_on` int(11) default NULL, | ||
+ | |||
`qualifying_races` text, | `qualifying_races` text, | ||
+ | |||
`idchallenge` text, | `idchallenge` text, | ||
+ | |||
`coastpenalty` int(11) default '0', | `coastpenalty` int(11) default '0', | ||
+ | |||
`bobegin` bigint(20) default '0', | `bobegin` bigint(20) default '0', | ||
+ | |||
`boend` bigint(20) default '0', | `boend` bigint(20) default '0', | ||
+ | |||
`maxboats` int(11) default '0', | `maxboats` int(11) default '0', | ||
+ | |||
`theme` varchar(30) default NULL, | `theme` varchar(30) default NULL, | ||
+ | |||
PRIMARY KEY (`idraces`) | PRIMARY KEY (`idraces`) | ||
+ | |||
) COMMENT='The races that exist'; | ) COMMENT='The races that exist'; | ||
+ | |||
+ | |||
CREATE TABLE `races_instructions` ( | CREATE TABLE `races_instructions` ( | ||
+ | |||
`idraces` int(11) default NULL, | `idraces` int(11) default NULL, | ||
+ | |||
`instructions` text, | `instructions` text, | ||
+ | |||
`flag` int(11), | `flag` int(11), | ||
+ | |||
KEY (`idraces`) | KEY (`idraces`) | ||
+ | |||
); | ); | ||
+ | |||
+ | |||
-- Table structure for table `waypoints` | -- Table structure for table `waypoints` | ||
+ | |||
-- Cf. table races_waypoints | -- Cf. table races_waypoints | ||
+ | |||
CREATE TABLE `waypoints` ( | CREATE TABLE `waypoints` ( | ||
+ | |||
`idwaypoint` int(20) NOT NULL default '0', | `idwaypoint` int(20) NOT NULL default '0', | ||
+ | |||
`latitude1` double default NULL, | `latitude1` double default NULL, | ||
+ | |||
`longitude1` double default NULL, | `longitude1` double default NULL, | ||
+ | |||
`latitude2` double default NULL, | `latitude2` double default NULL, | ||
+ | |||
`longitude2` double default NULL, | `longitude2` double default NULL, | ||
+ | |||
`libelle` varchar(255) default NULL, | `libelle` varchar(255) default NULL, | ||
+ | |||
`maparea` int(11) default '10', | `maparea` int(11) default '10', | ||
+ | |||
PRIMARY KEY (`idwaypoint`) | PRIMARY KEY (`idwaypoint`) | ||
+ | |||
); | ); | ||
+ | |||
CREATE TABLE `races_waypoints` ( | CREATE TABLE `races_waypoints` ( | ||
+ | |||
`idraces` int(11) NOT NULL default '0', | `idraces` int(11) NOT NULL default '0', | ||
+ | |||
`wporder` int(11) NOT NULL default '0', | `wporder` int(11) NOT NULL default '0', | ||
+ | |||
`idwaypoint` int(20) default NULL, | `idwaypoint` int(20) default NULL, | ||
− | `laisser_au` int(11) default NULL, -- si dans table waypoints latitude1 = latitude2 ET longitude1 = longitude2, alors le wp est de type laisser_au | + | |
+ | `laisser_au` int(11) default NULL, -- si dans table waypoints latitude1 = latitude2 ET longitude1 = longitude2, alors le wp est de | ||
+ | type laisser_au | ||
+ | |||
`wptype` varchar(32) default NULL, | `wptype` varchar(32) default NULL, | ||
+ | |||
PRIMARY KEY (`idraces`,`wporder`) | PRIMARY KEY (`idraces`,`wporder`) | ||
+ | |||
)COMMENT='Race waypoints'; | )COMMENT='Race waypoints'; | ||
− | + | ||
</nowiki> | </nowiki> |
Version du 23 septembre 2009 à 07:56
extraite de http://dev.virtual-loup-de-mer.org/vlm/browser/trunk/base/schemas/races_tables.sql RACES, WAYPOINTS, RACES_WAYPOINTS, races_instructions
- Créer une course,
- ajouter une ligne dans "races"
- ajounter N lignes dans "waypoints" (une par waypoint)
- faire la relation 1,N (intégrant l'ordonnancement des WP) dans races_waypoint
- jusqu'à la version 0.8 incluse, la table races_instructions n'est pas utilisée
CREATE TABLE `races` ( `idraces` int(11) NOT NULL auto_increment, `racename` varchar(255) NOT NULL default '', `started` int(11) NOT NULL default '0', `deptime` bigint(14) default NULL, `startlong` int(11) NOT NULL default '0', `startlat` int(11) NOT NULL default '0', `boattype` varchar(255) default NULL, `closetime` bigint(20) default NULL, `racetype` int(11) default NULL, `firstpcttime` bigint(20) default NULL, `depend_on` int(11) default NULL, `qualifying_races` text, `idchallenge` text, `coastpenalty` int(11) default '0', `bobegin` bigint(20) default '0', `boend` bigint(20) default '0', `maxboats` int(11) default '0', `theme` varchar(30) default NULL, PRIMARY KEY (`idraces`) ) COMMENT='The races that exist'; CREATE TABLE `races_instructions` ( `idraces` int(11) default NULL, `instructions` text, `flag` int(11), KEY (`idraces`) ); -- Table structure for table `waypoints` -- Cf. table races_waypoints CREATE TABLE `waypoints` ( `idwaypoint` int(20) NOT NULL default '0', `latitude1` double default NULL, `longitude1` double default NULL, `latitude2` double default NULL, `longitude2` double default NULL, `libelle` varchar(255) default NULL, `maparea` int(11) default '10', PRIMARY KEY (`idwaypoint`) ); CREATE TABLE `races_waypoints` ( `idraces` int(11) NOT NULL default '0', `wporder` int(11) NOT NULL default '0', `idwaypoint` int(20) default NULL, `laisser_au` int(11) default NULL, -- si dans table waypoints latitude1 = latitude2 ET longitude1 = longitude2, alors le wp est de type laisser_au `wptype` varchar(32) default NULL, PRIMARY KEY (`idraces`,`wporder`) )COMMENT='Race waypoints';