Skip to content

Commit

Permalink
Fixed #78? Better default date for new words.
Browse files Browse the repository at this point in the history
Invalid default value for 'WoStatusChanged' #78
  • Loading branch information
HugoFara committed Jan 21, 2023
1 parent 7646ca4 commit fea281c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ For git tags, official releases are marked like "v1.0.0", while unofficial ones
### Fixed

* Markdown: enforced consistency with official style recomendations. The documentation display got improved.
* The default date for new words was note accepted depending on the SQL configuration, causing issues with Docker installation. See [#78](https://github.com/HugoFara/lwt/issues/78).

## [Unreleased]

Expand Down
1 change: 1 addition & 0 deletions docs/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,7 @@ <h3>[Unreleased]</h3>
<h4>Fixed</h4>
<ul>
<li>Markdown: enforced consistency with official style recomendations. The documentation display got improved.</li>
<li>The default date for new words was note accepted depending on the SQL configuration, causing issues with Docker installation. See <a href="https://github.com/HugoFara/lwt/issues/78">#78</a>.</li>
</ul>
<h3>2.6.0-fork (January 01 2023)</h3>
<h4>Added</h4>
Expand Down
38 changes: 19 additions & 19 deletions inc/database_connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ function check_update_db($debug, $tbpref, $dbname): void

// Rebuild Tables if missing (current versions!)

if (!in_array($tbpref . 'archivedtexts', $tables)) {
if (!in_array("{$tbpref}archivedtexts", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding archivedtexts</p>';
}
Expand All @@ -1784,7 +1784,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'languages', $tables)) {
if (!in_array("{$tbpref}languages", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding languages</p>';
}
Expand Down Expand Up @@ -1812,7 +1812,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'sentences', $tables)) {
if (!in_array("{$tbpref}sentences", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding sentences</p>';
}
Expand All @@ -1834,7 +1834,7 @@ function check_update_db($debug, $tbpref, $dbname): void
$count++;
}

if (!in_array($tbpref . 'settings', $tables)) {
if (!in_array("{$tbpref}settings", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding settings</p>';
}
Expand All @@ -1849,7 +1849,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'textitems2', $tables)) {
if (!in_array("{$tbpref}textitems2", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding textitems2</p>';
}
Expand All @@ -1868,7 +1868,7 @@ function check_update_db($debug, $tbpref, $dbname): void
''
);
// Add data from the old database system
if (in_array($tbpref . 'textitems', $tables)) {
if (in_array("{$tbpref}textitems", $tables)) {
runsql(
"INSERT INTO {$tbpref}textitems2 (
Ti2WoID, Ti2LgID, Ti2TxID, Ti2SeID, Ti2Order, Ti2WordCount,
Expand All @@ -1886,13 +1886,13 @@ function check_update_db($debug, $tbpref, $dbname): void
WHERE TiWordCount<2 OR WoID IS NOT NULL",
''
);
runsql('TRUNCATE ' . $tbpref . 'textitems', '');
runsql("TRUNCATE {$tbpref}textitems", '');
}
$count++;
}


if (!in_array($tbpref . 'temptextitems', $tables)) {
if (!in_array("{$tbpref}temptextitems", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding temptextitems</p>';
}
Expand All @@ -1908,7 +1908,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'tempwords', $tables)) {
if (!in_array("{$tbpref}tempwords", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding tempwords</p>';
}
Expand All @@ -1926,7 +1926,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'texts', $tables)) {
if (!in_array("{$tbpref}texts", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding texts</p>';
}
Expand All @@ -1949,7 +1949,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'words', $tables)) {
if (!in_array("{$tbpref}words", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding words</p>';
}
Expand All @@ -1965,7 +1965,7 @@ function check_update_db($debug, $tbpref, $dbname): void
WoSentence varchar(1000) DEFAULT NULL,
WoWordCount tinyint(3) unsigned NOT NULL DEFAULT 0,
WoCreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
WoStatusChanged timestamp NOT NULL DEFAULT '0000-00-00 00:00:01',
WoStatusChanged timestamp NOT NULL DEFAULT '1970-01-01 12:00:00',
WoTodayScore double NOT NULL DEFAULT '0',
WoTomorrowScore double NOT NULL DEFAULT '0',
WoRandom double NOT NULL DEFAULT '0',
Expand All @@ -1986,7 +1986,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'tags', $tables)) {
if (!in_array("{$tbpref}tags", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding tags</p>';
}
Expand All @@ -2002,7 +2002,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'wordtags', $tables)) {
if (!in_array("{$tbpref}wordtags", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding wordtags</p>';
}
Expand All @@ -2017,7 +2017,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'tags2', $tables)) {
if (!in_array("{$tbpref}tags2", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding tags2</p>';
}
Expand All @@ -2033,7 +2033,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'texttags', $tables)) {
if (!in_array("{$tbpref}texttags", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding texttags</p>';
}
Expand All @@ -2047,7 +2047,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'newsfeeds', $tables)) {
if (!in_array("{$tbpref}newsfeeds", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding newsfeeds</p>';
}
Expand All @@ -2069,7 +2069,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'feedlinks', $tables)) {
if (!in_array("{$tbpref}feedlinks", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding feedlinks</p>';
}
Expand All @@ -2092,7 +2092,7 @@ function check_update_db($debug, $tbpref, $dbname): void
);
}

if (!in_array($tbpref . 'archtexttags', $tables)) {
if (!in_array("{$tbpref}archtexttags", $tables)) {
if ($debug) {
echo '<p>DEBUG: rebuilding archtexttags</p>';
}
Expand Down

0 comments on commit fea281c

Please sign in to comment.