diff options
author | Kyle McFarland <tfkyle@gmail.com> | 2018-01-31 00:51:07 -0600 |
---|---|---|
committer | Kyle McFarland <tfkyle@gmail.com> | 2018-01-31 00:51:07 -0600 |
commit | 61d1aa04d8d44b17bfe6dace90088669fc6c3df8 (patch) | |
tree | 7ede15c880e4c41a18cded46fe6d03fb2dc4543b /common/tables/task_claims.php | |
download | mcoop-61d1aa04d8d44b17bfe6dace90088669fc6c3df8.zip mcoop-61d1aa04d8d44b17bfe6dace90088669fc6c3df8.tar.gz mcoop-61d1aa04d8d44b17bfe6dace90088669fc6c3df8.tar.bz2 |
* Registration system's almost done
* Just part way through implementing tasks
So not much done yet, but it's a start.
Diffstat (limited to 'common/tables/task_claims.php')
-rw-r--r-- | common/tables/task_claims.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/common/tables/task_claims.php b/common/tables/task_claims.php new file mode 100644 index 0000000..4f30964 --- /dev/null +++ b/common/tables/task_claims.php @@ -0,0 +1,32 @@ +<?php +namespace mcoop; +require_once("common/db_classes.php"); + +class TaskClaimsUpgrader extends BaseIncrementalTableUpgrader { + function __construct($conn) { + $this->conn = $conn; + $this->table_name = "task_claims"; + } +} + +$task_claims_table_decl = new SimpleTableDecl( + "task_claims", + array( + "create_task_claim" => "INSERT INTO task_claims (task_id, userid, last_updated_table_version, description) VALUES (:task_id, :userid, :table_ver, :description)", + // something that might be interesting is also keying on WHERE userid=:userid so the user that created it's the only one that can update it, I'll probably do something with perms though (that's a TODO) + "update_task_claim_desc" => "UPDATE task_claims SET description=:desc WHERE claim_id=:claim_id", + "get_task_claim_ids_by_taskid" => "SELECT claim_id FROM task_claims WHERE task_id=:task_id", + "get_task_claims_by_taskid" => "SELECT * FROM task_claims WHERE task_id=:task_id" + ), + "CREATE TABLE `task_claims` ( +`claim_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +`task_id` INT NOT NULL, +`userid` INT NOT NULL, +`last_updated_table_version` INT NOT NULL, +`description` TEXT CHARACTER SET utf8 +);", + 1, + "\mcoop\TaskClaimsUpgrader" +); + +?> |