<?php
/**
 * Generated: 2014-06-26 13:36:00
 * @author Rtn_Module_Tool
 */

class Forms_Module_Initer_DB {

	static $sql_before = "";
	static $sql_after = "";

	static function init() {
		empty(static::$sql_before) || R::exec(static::$sql_before);
		
		$q = <<<EOF
			CREATE OR REPLACE VIEW viewformfields AS
			SELECT
				formfields.*,
				formfieldtypes.description AS fieldname,
				formfieldtypes.class AS class,
				formfieldtypes.name AS inputname
			FROM
				formfields
			JOIN
				formfieldtypes ON (formfieldtypes.id = formfields.formfieldtypes_id);
EOF;
		R::exec($q);
		
		empty(static::$sql_after) || R::exec(static::$sql_after);
	}

}

