diff options
Diffstat (limited to 'common/tables/tcc_history.php')
-rw-r--r-- | common/tables/tcc_history.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/common/tables/tcc_history.php b/common/tables/tcc_history.php new file mode 100644 index 0000000..362d702 --- /dev/null +++ b/common/tables/tcc_history.php @@ -0,0 +1,31 @@ +<?php +namespace mcoop; +require_once("common/db_classes.php"); + +// tcc stands for Task Claim Credits + +class TccHistoryUpgrader extends BaseIncrementalTableUpgrader { + function __construct($conn) { + $this->conn = $conn; + $this->table_name = "tcc_history"; + } +} + +$tcc_history_table_decl = new SimpleTableDecl( + "tcc_history", + array( + "get_tcc_history_by_claimid" => "SELECT * FROM tcc_history WHERE to_claim_id=:claimid", + "get_tcc_history_by_tdc_id" => "SELECT * FROM tcc_history WHERE from_tdc_id=:tdc_id" + ), + "CREATE TABLE `tcc_history` ( +`from_tdc_id` INT NOT NULL, +`to_claim_id` INT NOT NULL, +`action` ENUM ('award', 'rescind') NOT NULL, +`credits` BIGINT NOT NULL, +`last_updated_table_version` INT NOT NULL +);", + 1, + "\mcoop\TccHistoryUpgrader" +); + +?> |