forked from piernov/zotprime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove timestamp/version columns from libraries table on master [DB u…
…pdate] Avoid writing to master on every write and just update the timestamp and version in the shard's shardLibraries table
- Loading branch information
Showing
7 changed files
with
79 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/php -d mysqlnd.net_read_timeout=3600 | ||
<?php | ||
set_include_path("../../../include"); | ||
require("header.inc.php"); | ||
|
||
// Run this before rolling out code changes | ||
Zotero_Admin_DB::query("ALTER TABLE `libraries` ADD `hasData` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `version` , ADD INDEX ( `hasData` )"); | ||
Zotero_DB::query("UPDATE `libraries` SET hasData=1 WHERE version > 0 OR lastUpdated != '0000-00-00 00:00:00'"); |
8 changes: 8 additions & 0 deletions
8
misc/db-updates/2021-10-16/1_removeMasterGroupTimestampAndVersion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/php -d mysqlnd.net_read_timeout=3600 | ||
<?php | ||
set_include_path("../../../include"); | ||
require("header.inc.php"); | ||
|
||
// Run this after rolling out code changes | ||
Zotero_DB::query("UPDATE `libraries` SET hasData=1 WHERE version > 0 OR lastUpdated != '0000-00-00 00:00:00'"); | ||
Zotero_Admin_DB::query("ALTER TABLE `libraries` DROP COLUMN `lastUpdated`, DROP COLUMN `version`"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters