The car categories and tracks are now stored in 2 tables in the database, so the 2 files containing this information are no longer used.

This commit is contained in:
Alfonso Saavedra "Son Link" 2024-04-07 22:32:24 +02:00
parent a035e46a59
commit 9ce843fc9d
No known key found for this signature in database
GPG Key ID: D3594BCF897F74D8
3 changed files with 33 additions and 3 deletions

View File

@ -0,0 +1,9 @@
<?php
namespace App\Models;
use App\Models\BaseModel;
class CarCatsModel extends BaseModel
{
protected $table = 'cars_cats';
protected $allowedFields = ['id', 'name', 'carId'];
}

View File

@ -0,0 +1,9 @@
<?php
namespace App\Models;
use App\Models\BaseModel;
class TrackCatsModel extends BaseModel
{
protected $table = 'tracks_cats';
protected $allowedFields = ['id', 'name', 'trackID'];
}

View File

@ -6,7 +6,7 @@ CREATE TABLE `laps` (
`position` int(5) NOT NULL, `position` int(5) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(), `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
`wettness` int(2) NOT NULL `wettness` int(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8_general_ci; ) ENGINE=MyISAM;
CREATE TABLE `races` ( CREATE TABLE `races` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
@ -20,7 +20,7 @@ CREATE TABLE `races` (
`endposition` int(5) DEFAULT NULL, `endposition` int(5) DEFAULT NULL,
`sdversion` varchar(100) NOT NULL, `sdversion` varchar(100) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8_general_ci; ) ENGINE=MyISAM;
CREATE TABLE `users` ( CREATE TABLE `users` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
@ -33,7 +33,7 @@ CREATE TABLE `users` (
`sessionid` varchar(50) DEFAULT NULL, `sessionid` varchar(50) DEFAULT NULL,
`sessionip` varchar(15) DEFAULT NULL, `sessionip` varchar(15) DEFAULT NULL,
`sessiontimestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' `sessiontimestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8_general_ci; ) ENGINE=MyISAM;
ALTER TABLE `laps` ALTER TABLE `laps`
ADD PRIMARY KEY (`id`); ADD PRIMARY KEY (`id`);
@ -54,3 +54,15 @@ ALTER TABLE `races`
ALTER TABLE `users` ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT; COMMIT;
CREATE TABLE IF NOT EXISTS `cars_cats` (
`id` varchar(20) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`carID` varchar(50) DEFAULT NULL
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `tracks_cats` (
`id` varchar(20) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`trackID` varchar(50) DEFAULT NULL
) ENGINE=InnoDB;