conn = $conn; $this->table_name = "task_dividend_credits"; } } $task_dividend_credits_table_decl = new SimpleTableDecl( "task_dividend_credits", array( "create_new_tdc" => "INSERT INTO task_dividend_credits (task_id, posted_userid, posted_by_coop, total_credits, remaining_credits, last_updated_table_version) VALUES (:task_id, :userid, :coop_post, :credits, :credits, :table_ver)", "tdc_remove_credits" => "UPDATE task_dividend_credits SET remaining_credits=remaining_credits - :amount WHERE tdc_id = :tdc_id", "get_tdcs_by_taskid" => "SELECT * FROM task_dividend_credits WHERE task_id=:task_id" ), "CREATE TABLE `task_dividend_credits` ( `tdc_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `task_id` INT NOT NULL, `posted_userid` INT NOT NULL, `posted_by_coop` BOOL NOT NULL, `total_credits` BIGINT NOT NULL, `remaining_credits` BIGINT NOT NULL, `last_updated_table_version` INT NOT NULL );", 1, "\mcoop\TaskDividendCreditsUpgrader" ); ?>