summaryrefslogtreecommitdiff
path: root/common/tables/tcc_history.php
blob: 362d702eae7ba0048492b90007e9bab21b43f6ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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"
);

?>