Convert from timestamp to datetime. Datetime is consistent between mysql 4.0x and newer

versions and is faster for date/time computations. Modify object creation methods to specify
any time fields that were previously updated with timestamp properties.
This commit is contained in:
Chris Morgan
2007-07-31 23:48:22 +00:00
committed by WineHQ
parent 8b7fdf606c
commit b94a2a392b
22 changed files with 96 additions and 81 deletions

View File

@@ -153,7 +153,7 @@ class appData
$sLink, $sLink,
$oRow->type, $oRow->type,
$oRow->description, $oRow->description,
print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime))),
($i % 2) ? "color0" : "color1"); ($i % 2) ? "color0" : "color1");
} }
@@ -500,7 +500,7 @@ class appData
$oUser = new User($this->iSubmitterId); $oUser = new User($this->iSubmitterId);
$oTableRow = new TableRow(); $oTableRow = new TableRow();
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime))); $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime)));
$oTableRow->AddTextCell($oUser->objectMakeLink()); $oTableRow->AddTextCell($oUser->objectMakeLink());
$oTableRow->AddTextCell($oApp->objectMakeLink()); $oTableRow->AddTextCell($oApp->objectMakeLink());
$oTableRow->AddTextCell($this->iVersionId ? $oVersion->objectMakeLink() : "N/A"); $oTableRow->AddTextCell($this->iVersionId ? $oVersion->objectMakeLink() : "N/A");

View File

@@ -121,12 +121,14 @@ class Application {
if(!$_SESSION['current']->canCreateApplication()) if(!$_SESSION['current']->canCreateApplication())
return; return;
$hResult = query_parameters("INSERT INTO appFamily (appName, description, keywords, ". $hResult = query_parameters("INSERT INTO appFamily (appName, description, ".
"webPage, vendorId, catId, submitterId, queued) VALUES (". "keywords, webPage, vendorId, catId, ".
"'?', '?', '?', '?', '?', '?', '?', '?')", "submitTime, submitterId, ".
"queued) VALUES (".
"'?', '?', '?', '?', '?', '?', ?, '?', '?')",
$this->sName, $this->sDescription, $this->sKeywords, $this->sName, $this->sDescription, $this->sKeywords,
$this->sWebpage, $this->iVendorId, $this->iCatId, $this->sWebpage, $this->iVendorId, $this->iCatId,
$_SESSION['current']->iUserId, "NOW()", $_SESSION['current']->iUserId,
$this->mustBeQueued() ? "true" : "false"); $this->mustBeQueued() ? "true" : "false");
if($hResult) if($hResult)
{ {
@@ -804,7 +806,7 @@ class Application {
$oTableRow->AddTextCell($oApp->objectMakeLink()); $oTableRow->AddTextCell($oApp->objectMakeLink());
$oTableRow->AddTextCell($oRow->description); $oTableRow->AddTextCell($oRow->description);
$oTableRow->AddTextCell($oVendor->objectMakeLink()); $oTableRow->AddTextCell($oVendor->objectMakeLink());
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))); $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime)));
$oTableRow->SetClass(($i % 2) ? "color0" : "color1"); $oTableRow->SetClass(($i % 2) ? "color0" : "color1");
$oTable->AddRow($oTableRow); $oTable->AddRow($oTableRow);
@@ -902,7 +904,7 @@ class Application {
$sVendor = $oVendor->objectMakeLink(); $sVendor = $oVendor->objectMakeLink();
$oTableRow = new TableRow(); $oTableRow = new TableRow();
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime))); $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime)));
$oTableRow->AddTextCell($oUser->objectMakeLink()); $oTableRow->AddTextCell($oUser->objectMakeLink());
$oTableRow->AddTextCell($sVendor); $oTableRow->AddTextCell($sVendor);
$oTableRow->AddTextCell($this->sName); $oTableRow->AddTextCell($this->sName);

View File

@@ -77,7 +77,7 @@ class browse_newest_apps
$oTableRow = new TableRow(); $oTableRow = new TableRow();
$oTableCell = new TableCell(print_short_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime))); $oTableCell = new TableCell(print_short_date(mysqldatetime_to_unixtimestamp($oApp->sSubmitTime)));
$oTableCell->SetWidth("20%"); $oTableCell->SetWidth("20%");
$oTableRow->AddCell($oTableCell); $oTableRow->AddCell($oTableCell);
$oTableRow->AddTextCell($oApp->objectMakeLink()); $oTableRow->AddTextCell($oApp->objectMakeLink());

View File

@@ -120,11 +120,13 @@ class Bug {
/* passed the checks so lets insert the puppy! */ /* passed the checks so lets insert the puppy! */
$hResult = query_parameters("INSERT INTO buglinks (versionId, bug_id, queued, submitterId) ". $hResult = query_parameters("INSERT INTO buglinks (versionId, bug_id, ".
"VALUES('?', '?', '?', '?')", "submitTime, submitterId, queued) ".
"VALUES('?', '?', ?, '?', '?')",
$this->iVersionId, $this->iBug_id, $this->iVersionId, $this->iBug_id,
$this->bQueued ? "true":"false", "NOW()",
$_SESSION['current']->iUserId); $_SESSION['current']->iUserId,
$this->bQueued ? "true":"false");
if($hResult) if($hResult)
{ {
$this->iLinkId = mysql_insert_id(); $this->iLinkId = mysql_insert_id();
@@ -279,7 +281,7 @@ class Bug {
$oBug->sBug_status, $oBug->sBug_status,
$oBug->sResolution, $oBug->sResolution,
$oBug->sShort_desc, $oBug->sShort_desc,
print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime))),
($i % 2) ? "color0" : "color1"); ($i % 2) ? "color0" : "color1");
} }

View File

@@ -99,9 +99,11 @@ class distribution {
} }
} }
$hResult = query_parameters("INSERT INTO distributions (name, url, submitterId, queued) ". $hResult = query_parameters("INSERT INTO distributions (name, url, submitTime, ".
"VALUES ('?', '?', '?', '?')", "submitterId, queued) ".
"VALUES ('?', '?', ?, '?', '?')",
$this->sName, $this->sUrl, $this->sName, $this->sUrl,
"NOW()",
$_SESSION['current']->iUserId, $_SESSION['current']->iUserId,
$this->mustBeQueued() ? "true" : "false"); $this->mustBeQueued() ? "true" : "false");
if($hResult) if($hResult)
@@ -570,7 +572,7 @@ class distribution {
else else
echo $oSubmitter->sRealname; echo $oSubmitter->sRealname;
echo '</td>',"\n"; echo '</td>',"\n";
echo '<td>'.date("M d Y", mysqltimestamp_to_unixtimestamp($oTest->sSubmitTime)).'</td>',"\n"; echo '<td>'.date("M d Y", mysqldatetime_to_unixtimestamp($oTest->sSubmitTime)).'</td>',"\n";
echo '<td>'.$oTest->sTestedRelease.'&nbsp</td>',"\n"; echo '<td>'.$oTest->sTestedRelease.'&nbsp</td>',"\n";
echo '<td>'.$oTest->sInstalls.'&nbsp</td>',"\n"; echo '<td>'.$oTest->sInstalls.'&nbsp</td>',"\n";
echo '<td>'.$oTest->sRuns.'&nbsp</td>',"\n"; echo '<td>'.$oTest->sRuns.'&nbsp</td>',"\n";

View File

@@ -297,11 +297,13 @@ class downloadurl
return FALSE; return FALSE;
$hResult = query_parameters("INSERT INTO appData (versionId, type, $hResult = query_parameters("INSERT INTO appData (versionId, type,
description, url, queued, submitterId) description, url, queued, submitTime, submitterId)
VALUES('?','?','?','?','?','?')", VALUES('?', '?', '?', '?', '?', ?, '?')",
$this->iVersionId, "downloadurl", $this->sDescription, $this->iVersionId, "downloadurl", $this->sDescription,
$this->sUrl, downloadurl::canEdit($this->iVersionId) ? $this->sUrl,
"false" : "true", $_SESSION['current']->iUserId); downloadurl::canEdit($this->iVersionId) ? "false" : "true",
"NOW()",
$_SESSION['current']->iUserId);
$this->iId = mysql_insert_id(); $this->iId = mysql_insert_id();
if(!$hResult) if(!$hResult)

View File

@@ -75,9 +75,11 @@ class Monitor {
return FALSE; return FALSE;
// create the new monitor entry // create the new monitor entry
$hResult = query_parameters("INSERT INTO appMonitors (versionId, appId, userId) ". $hResult = query_parameters("INSERT INTO appMonitors (versionId, appId,".
"VALUES ('?', '?', '?')", "submitTime, userId) ".
$this->iVersionId, $this->iAppId, $this->iUserId); "VALUES ('?', '?', ?, '?')",
$this->iVersionId, $this->iAppId,
"NOW()", $this->iUserId);
if($hResult) if($hResult)
{ {

View File

@@ -53,11 +53,14 @@ class Note {
*/ */
function create() function create()
{ {
$hResult = query_parameters("INSERT INTO appNotes (versionId, noteTitle, noteDesc, submitterId) ". $hResult = query_parameters("INSERT INTO appNotes (versionId, ".
"VALUES('?', '?', '?', '?')", "noteTitle, noteDesc, submitterId, ".
"submitTime) ".
"VALUES('?', '?', '?', '?', ?)",
$this->iVersionId, $this->sTitle, $this->iVersionId, $this->sTitle,
$this->shDescription, $this->shDescription,
$_SESSION['current']->iUserId); $_SESSION['current']->iUserId,
"NOW()");
if($hResult) if($hResult)
{ {
@@ -154,7 +157,8 @@ class Note {
$oSubmitter = new User($this->iSubmitterId); $oSubmitter = new User($this->iSubmitterId);
$sSubject = "Note $this->sTitle for $sAppName has been deleted by ". $sSubject = "Note $this->sTitle for $sAppName has been deleted by ".
$_SESSION['current']->sRealname; $_SESSION['current']->sRealname;
$sMsg .= "This note was made on ".print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime))." by ".$oSubmitter->sRealname."\n"; $sMsg .= "This note was made on ".print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime)).
" by ".$oSubmitter->sRealname."\n";
$sMsg .= "\n"; $sMsg .= "\n";
$sMsg .= "Subject: ".$this->sTitle."\n"; $sMsg .= "Subject: ".$this->sTitle."\n";
$sMsg .= "\n"; $sMsg .= "\n";

View File

@@ -71,11 +71,12 @@ class screenshot
function create() function create()
{ {
$hResult = query_parameters("INSERT INTO appData $hResult = query_parameters("INSERT INTO appData
(versionId, type, description, queued, submitterId) (versionId, type, description, queued, submitTime, submitterId)
VALUES('?', '?', '?', '?', '?')", VALUES('?', '?', '?', '?', ?, '?')",
$this->iVersionId, "screenshot", $this->iVersionId, "screenshot",
$this->sDescription, $this->sDescription,
$this->mustBeQueued() ? "true" : "false", $this->mustBeQueued() ? "true" : "false",
"NOW()",
$_SESSION['current']->iUserId); $_SESSION['current']->iUserId);
if($hResult) if($hResult)
{ {

View File

@@ -65,9 +65,11 @@ class testData{
{ {
$hResult = query_parameters("INSERT INTO testResults (versionId, whatWorks, whatDoesnt,". $hResult = query_parameters("INSERT INTO testResults (versionId, whatWorks, whatDoesnt,".
"whatNotTested, testedDate, distributionId, testedRelease,". "whatNotTested, testedDate, distributionId, testedRelease,".
"installs, runs, testedRating, comments, submitterId, queued)". "installs, runs, testedRating, comments,".
" VALUES('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',". "submitTime, submitterId, queued)".
"'?', '?')", "VALUES('?', '?', '?', '?', '?', '?', '?',".
"'?', '?', '?', '?',".
"?, '?', '?')",
$this->iVersionId, $this->shWhatWorks, $this->iVersionId, $this->shWhatWorks,
$this->shWhatDoesnt, $this->shWhatDoesnt,
$this->shWhatNotTested, $this->sTestedDate, $this->shWhatNotTested, $this->sTestedDate,
@@ -75,6 +77,7 @@ class testData{
$this->sTestedRelease, $this->sInstalls, $this->sTestedRelease, $this->sInstalls,
$this->sRuns, $this->sRuns,
$this->sTestedRating, $this->sComments, $this->sTestedRating, $this->sComments,
"NOW()",
$_SESSION['current']->iUserId, $_SESSION['current']->iUserId,
$this->mustBeQueued() ? "true" : "false"); $this->mustBeQueued() ? "true" : "false");
@@ -812,7 +815,7 @@ class testData{
version::fullNameLink($oRow->versionId), version::fullNameLink($oRow->versionId),
$oRow->testedRating, $oRow->testedRating,
$oRow->testedRelease, $oRow->testedRelease,
print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))), print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime))),
$oRow->testedRating); $oRow->testedRating);
$sReturn .= html_table_end(); $sReturn .= html_table_end();
@@ -1014,7 +1017,7 @@ class testData{
$bHasMaintainer = (mysql_num_rows($hMaintainers) == 0) ? false : true; $bHasMaintainer = (mysql_num_rows($hMaintainers) == 0) ? false : true;
$oTableRow = new TableRow(); $oTableRow = new TableRow();
$oTableRow->AddCell(new TableCell(print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime)))); $oTableRow->AddCell(new TableCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime))));
$oTableRow->AddCell(new TableCell($oUser->objectMakeLink())); $oTableRow->AddCell(new TableCell($oUser->objectMakeLink()));
$oTableRow->AddCell(new TableCell($oApp->objectMakeLink())); $oTableRow->AddCell(new TableCell($oApp->objectMakeLink()));
$oTableRow->AddCell(new TableCell($oVersion->objectMakeLink())); $oTableRow->AddCell(new TableCell($oVersion->objectMakeLink()));

View File

@@ -54,7 +54,8 @@ class Url {
/** /**
* Creates a new url. * Creates a new url.
*/ */
function create($sDescription = null, $sUrl = null, $iVersionId = null, $iAppId = null, $bSilent = false) function create($sDescription = null, $sUrl = null, $iVersionId = null,
$iAppId = null, $bSilent = false)
{ {
global $aClean; global $aClean;
@@ -64,11 +65,11 @@ class Url {
$this->bQueued = true; $this->bQueued = true;
$hResult = query_parameters("INSERT INTO appData (appId, versionId, type, $hResult = query_parameters("INSERT INTO appData (appId, versionId, type,
description, queued, submitterId, url) description, queued, submitTime, submitterId, url)
VALUES ('?', '?', '?', '?', '?', '?', '?')", VALUES ('?', '?', '?', '?', '?', ?, '?', '?')",
$iAppId, $iVersionId, "url", $sDescription, $iAppId, $iVersionId, "url", $sDescription,
$this->bQueued ? "true" : "false", $this->bQueued ? "true" : "false",
$_SESSION['current']->iUserId, $sUrl); "NOW()", $_SESSION['current']->iUserId, $sUrl);
if(!$hResult) if(!$hResult)
{ {

View File

@@ -44,7 +44,6 @@ function build_urlarg($vars)
return implode("&", $arr); return implode("&", $arr);
} }
/* /*
* return all values of a mapping as an array * return all values of a mapping as an array
*/ */
@@ -56,7 +55,6 @@ function values($arr)
return $res; return $res;
} }
// print the month, day, year, hour, minute, second // print the month, day, year, hour, minute, second
function print_date($sTimestamp) function print_date($sTimestamp)
{ {
@@ -99,10 +97,7 @@ function mysqltimestamp_to_unixtimestamp($sTimestamp)
function mysqldatetime_to_unixtimestamp($sDatetime) function mysqldatetime_to_unixtimestamp($sDatetime)
{ {
sscanf($sDatetime, "%4s-%2s-%2s %2s:%2s:%2s", return strtotime($sDatetime);
&$y, &$m, &$d,
&$hours, &$minutes, &$seconds);
return mktime($hours,$minutes,$seconds,$m, $d, $y);
} }
function get_remote() function get_remote()

View File

@@ -86,10 +86,11 @@ class version {
$hResult = query_parameters("INSERT INTO appVersion $hResult = query_parameters("INSERT INTO appVersion
(versionName, description, maintainer_release, (versionName, description, maintainer_release,
maintainer_rating, appId, submitterId, queued, license) maintainer_rating, appId, submitTime, submitterId,
VALUES ('?', '?', '?', '?', '?', '?', '?', '?')", queued, license)
VALUES ('?', '?', '?', '?', '?', ?, '?', '?', '?')",
$this->sName, $this->sDescription, $this->sTestedRelease, $this->sName, $this->sDescription, $this->sTestedRelease,
$this->sTestedRating, $this->iAppId, $this->sTestedRating, $this->iAppId, "NOW()",
$_SESSION['current']->iUserId, $this->sQueued, $_SESSION['current']->iUserId, $this->sQueued,
$this->sLicense); $this->sLicense);
@@ -1216,7 +1217,7 @@ class version {
$oTableRow = new TableRow(); $oTableRow = new TableRow();
$oTableRow->AddTextCell(version::fullNameLink($oRow->versionId)); $oTableRow->AddTextCell(version::fullNameLink($oRow->versionId));
$oTableRow->AddTextCell($oRow->description); $oTableRow->AddTextCell($oRow->description);
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))); $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime)));
$oTableRow->SetClass(($i % 2) ? "color0" : "color1"); $oTableRow->SetClass(($i % 2) ? "color0" : "color1");
$oTable->AddRow($oTableRow); $oTable->AddRow($oTableRow);
@@ -1515,7 +1516,7 @@ class version {
$oVendor = new vendor($oApp->iVendorId); $oVendor = new vendor($oApp->iVendorId);
$oTableRow = new TableRow(); $oTableRow = new TableRow();
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime))); $oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime)));
$oTableRow->AddTextCell($oUser->objectMakeLink()); $oTableRow->AddTextCell($oUser->objectMakeLink());
$oTableRow->AddTextCell($oVendor->objectMakeLink()); $oTableRow->AddTextCell($oVendor->objectMakeLink());
$oTableRow->AddTextCell($oApp->objectMakeLink()); $oTableRow->AddTextCell($oApp->objectMakeLink());

View File

@@ -68,7 +68,7 @@ function vote_add($iVersionId, $iSlot, $iUserId = null)
vote_remove($iSlot, $iUserId); vote_remove($iSlot, $iUserId);
query_parameters("INSERT INTO appVotes (id, time, versionId, userId, slot) query_parameters("INSERT INTO appVotes (id, time, versionId, userId, slot)
VALUES (?, ?, '?', '?', '?')", "null", "null", VALUES (?, ?, '?', '?', '?')", "null", "NOW()",
$iVersionId, $iUserId, $iSlot); $iVersionId, $iUserId, $iSlot);
} }

View File

@@ -39,7 +39,7 @@ create table appFamily (
description text, description text,
webPage varchar(100), webPage varchar(100),
catId int, catId int,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
submitterId int(11) NOT NULL default '0', submitterId int(11) NOT NULL default '0',
queued enum('true','false','rejected') NOT NULL default 'false', queued enum('true','false','rejected') NOT NULL default 'false',
key(appId) key(appId)
@@ -56,7 +56,7 @@ create table appVersion (
description text, description text,
maintainer_rating text, maintainer_rating text,
maintainer_release text, maintainer_release text,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
submitterId int(11) NOT NULL default '0', submitterId int(11) NOT NULL default '0',
queued enum('true','false','rejected') NOT NULL default 'false', queued enum('true','false','rejected') NOT NULL default 'false',
license enum('Retail','Open Source','Freeware','Demo','Shareware'), license enum('Retail','Open Source','Freeware','Demo','Shareware'),
@@ -93,7 +93,7 @@ create table appBundle (
*/ */
create table appHitStats ( create table appHitStats (
appHitId int not null auto_increment, appHitId int not null auto_increment,
time timestamp, time datetime,
ip varchar(16), ip varchar(16),
appId int not null, appId int not null,
count int, count int,
@@ -102,7 +102,7 @@ create table appHitStats (
create table catHitStats ( create table catHitStats (
catHitId int not null auto_increment, catHitId int not null auto_increment,
time timestamp, time datetime,
ip varchar(16), ip varchar(16),
catId int not null, catId int not null,
count int, count int,
@@ -132,15 +132,15 @@ create table appComments (
* links to screenshots and other stuff * links to screenshots and other stuff
*/ */
create table appData ( create table appData (
id int not null auto_increment, id int not null auto_increment,
appId int not null, appId int not null,
versionId int default 0, versionId int default 0,
type enum('screenshot', 'url', 'bug','downloadurl'), type enum('screenshot', 'url', 'bug','downloadurl'),
description text, description text,
url varchar(255) default NULL, url varchar(255) default NULL,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
submitterId int(11) NOT NULL default '0', submitterId int(11) NOT NULL default '0',
queued enum('true','false','rejected') NOT NULL default 'false', queued enum('true','false','rejected') NOT NULL default 'false',
KEY id (id), KEY id (id),
KEY versionId (versionId) KEY versionId (versionId)
); );
@@ -152,7 +152,7 @@ create table appData (
*/ */
create table appVotes ( create table appVotes (
id int not null auto_increment, id int not null auto_increment,
time timestamp, time datetime,
versionId int not null, versionId int not null,
userId int not null, userId int not null,
slot int not null, slot int not null,
@@ -171,7 +171,7 @@ create table appNotes (
noteDesc text, noteDesc text,
versionId int not null, versionId int not null,
submitterId int not null, submitterId int not null,
submitTime timestamp not null, submitTime datetime not null,
key(noteId) key(noteId)
); );
@@ -181,7 +181,7 @@ create table appNotes (
*/ */
create table sessionMessages ( create table sessionMessages (
id int not null auto_increment, id int not null auto_increment,
time timestamp, time datetime,
sessionId varchar(32), sessionId varchar(32),
message text, message text,
key(id), key(id),

View File

@@ -6,7 +6,7 @@ CREATE TABLE banner (
alt varchar(255), alt varchar(255),
imp int not null, imp int not null,
clk int not null, clk int not null,
lastmod timestamp, lastmod datetime,
primary key(id) primary key(id)
) )

View File

@@ -9,7 +9,7 @@ create table buglinks (
linkId int not null auto_increment, linkId int not null auto_increment,
bug_id int not null, bug_id int not null,
versionId int not null, versionId int not null,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
submitterId int(11) NOT NULL default '0', submitterId int(11) NOT NULL default '0',
queued enum('true','false') NOT NULL default 'false', queued enum('true','false') NOT NULL default 'false',
key(linkId), key(linkId),

View File

@@ -6,13 +6,13 @@ drop table if exists distributions;
* Distributions table. * Distributions table.
*/ */
create table distributions ( create table distributions (
distributionId int not null auto_increment, distributionId int not null auto_increment,
name varchar(255) default NULL, name varchar(255) default NULL,
url varchar(255) default NULL, url varchar(255) default NULL,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
submitterId int(11) NOT NULL default '0', submitterId int(11) NOT NULL default '0',
queued enum('true','false','rejected') NOT NULL default 'false', queued enum('true','false','rejected') NOT NULL default 'false',
key(distributionId), key(distributionId),
index(name) index(name)
); );

View File

@@ -9,7 +9,7 @@ create table appMonitors (
monitorId int not null auto_increment, monitorId int not null auto_increment,
appId int not null, appId int not null,
versionId int not null, versionId int not null,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
userId int(11) NOT NULL default '0', userId int(11) NOT NULL default '0',
key(monitorId), key(monitorId),
index(appid), index(appid),

View File

@@ -8,6 +8,6 @@ CREATE TABLE session_list (
ip varchar(64) default NULL, ip varchar(64) default NULL,
data text, data text,
messages text, messages text,
stamp timestamp(14) NOT NULL, stamp datetime NOT NULL,
PRIMARY KEY (session_id) PRIMARY KEY (session_id)
) TYPE=MyISAM; ) TYPE=MyISAM;

View File

@@ -18,7 +18,7 @@ create table testResults (
runs enum('Yes','No','Not Installable') NOT NULL default 'Yes', runs enum('Yes','No','Not Installable') NOT NULL default 'Yes',
testedRating enum('Platinum','Gold','Silver','Bronze','Garbage') NOT NULL, testedRating enum('Platinum','Gold','Silver','Bronze','Garbage') NOT NULL,
comments text, comments text,
submitTime timestamp(14) NOT NULL, submitTime datetime NOT NULL,
submitterId int(11) NOT NULL default '0', submitterId int(11) NOT NULL default '0',
queued enum('true','false','rejected') NOT NULL default 'false', queued enum('true','false','rejected') NOT NULL default 'false',
key(testingId) key(testingId)

View File

@@ -3,13 +3,13 @@ use apidb;
drop table if exists user_list; drop table if exists user_list;
create table user_list ( create table user_list (
stamp timestamp not null, stamp datetime not null,
userid int not null auto_increment, userid int not null auto_increment,
password text not null, password text not null,
realname text not null, realname text not null,
email varchar(255) not null, email varchar(255) not null,
created datetime not null, created datetime not null,
inactivity_warn_stamp timestamp not null, /* the time we warned the user */ inactivity_warn_stamp datetime not null, /* the time we warned the user */
inactivity_warned enum('true','false') NOT NULL default 'false', /* if true, we warned the user */ inactivity_warned enum('true','false') NOT NULL default 'false', /* if true, we warned the user */
CVSrelease text, CVSrelease text,
unique key(userid), unique key(userid),