<?php
use SabaiApps\Directories\Application;

$tables = array(
	'view_view'   => array(
		'fields'         => array(
			'view_name'        => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'view_mode'        => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'view_data'        => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'view_bundle_name' => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'view_default'     => array(
				'type'    => Application::COLUMN_BOOLEAN,
				'notnull' => true,
				'default' => false,
			),
			'view_id'          => array(
				'autoincrement' => true,
				'type'          => Application::COLUMN_INTEGER,
				'unsigned'      => true,
				'notnull'       => true,
				'length'        => 10,
				'default'       => 0,
			),
			'view_created'     => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'view_updated'     => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'view_id'               => array(
				'primary' => true,
				'fields'  => array(
					'view_id' => array( 'sorting' => 'ascending' ),
				),
			),
			'view_bundle_name'      => array(
				'fields' => array(
					'view_bundle_name' => array(),
				),
			),
			'view_name_bundle_name' => array(
				'unique' => true,
				'fields' => array(
					'view_name'        => array(
						'sorting' => 'ascending',
					),
					'view_bundle_name' => array(
						'sorting' => 'ascending',
					),
				),
			),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
	'view_filter' => array(
		'fields'         => array(
			'filter_name'         => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 60,
				'default' => '',
			),
			'filter_type'         => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'filter_data'         => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'filter_bundle_name'  => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'filter_field_id'     => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'filter_display_name' => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 150,
				'default' => '',
			),
			'filter_id'           => array(
				'autoincrement' => true,
				'type'          => Application::COLUMN_INTEGER,
				'unsigned'      => true,
				'notnull'       => true,
				'length'        => 10,
				'default'       => 0,
			),
			'filter_created'      => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'filter_updated'      => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'filter_id'                       => array(
				'primary' => true,
				'fields'  => array(
					'filter_id' => array( 'sorting' => 'ascending' ),
				),
			),
			'filter_field_id'                 => array(
				'fields' => array(
					'filter_field_id' => array(),
				),
			),
			'filter_display_name_bundle_name' => array(
				'fields' => array(
					'filter_display_name' => array(
						'sorting' => 'ascending',
					),
					'filter_bundle_name'  => array(
						'sorting' => 'ascending',
					),
				),
			),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
);
return array(
	'charset'     => '',
	'description' => '',
	'tables'      => $tables,
);
