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" ); ?>