<?php
use SabaiApps\Directories\Application;

$tables = array(
	'voting_vote' => array(
		'fields'         => array(
			'vote_bundle_name'  => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'vote_entity_id'    => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'vote_value'        => array(
				'type'     => Application::COLUMN_DECIMAL,
				'unsigned' => false,
				'notnull'  => true,
				'length'   => 5,
				'scale'    => 2,
				'default'  => 0,
			),
			'vote_field_name'   => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'vote_name'         => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'vote_comment'      => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 255,
				'default' => '',
			),
			'vote_reference_id' => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'vote_hash'         => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 64,
				'default' => '',
			),
			'vote_level'        => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 5,
				'default'  => 0,
			),
			'vote_marked'       => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 1,
				'default'  => 0,
			),
			'vote_id'           => array(
				'autoincrement' => true,
				'type'          => Application::COLUMN_INTEGER,
				'unsigned'      => true,
				'notnull'       => true,
				'length'        => 10,
				'default'       => 0,
			),
			'vote_created'      => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'vote_updated'      => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'vote_user_id'      => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'vote_id'                                => array(
				'primary' => true,
				'fields'  => array(
					'vote_id' => array( 'sorting' => 'ascending' ),
				),
			),
			'vote_marked'                            => array(
				'fields' => array(
					'vote_marked' => array(),
				),
			),
			'vote_bundle_entity_field_user_name_ref' => array(
				'fields' => array(
					'vote_bundle_name'  => array(
						'sorting' => 'ascending',
					),
					'vote_entity_id'    => array(
						'sorting' => 'ascending',
					),
					'vote_field_name'   => array(
						'sorting' => 'ascending',
					),
					'vote_user_id'      => array(
						'sorting' => 'ascending',
					),
					'vote_name'         => array(
						'sorting' => 'ascending',
					),
					'vote_reference_id' => array(
						'sorting' => 'ascending',
					),
					'vote_hash'         => array(
						'sorting' => 'ascending',
					),
				),
			),
			'vote_user_id'                           => array( 'fields' => array( 'vote_user_id' => array() ) ),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
);
return array(
	'charset'     => '',
	'description' => '',
	'tables'      => $tables,
);
