<?php
use SabaiApps\Directories\Application;

$tables = array(
	'display_display' => array(
		'fields'         => array(
			'display_name'        => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 255,
				'default' => '',
			),
			'display_bundle_name' => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'display_type'        => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 10,
				'default' => '',
			),
			'display_data'        => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'display_id'          => array(
				'autoincrement' => true,
				'type'          => Application::COLUMN_INTEGER,
				'unsigned'      => true,
				'notnull'       => true,
				'length'        => 10,
				'default'       => 0,
			),
			'display_created'     => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'display_updated'     => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'display_id'                    => array(
				'primary' => true,
				'fields'  => array(
					'display_id' => array( 'sorting' => 'ascending' ),
				),
			),
			'display_bundle_name'           => array(
				'fields' => array(
					'display_bundle_name' => array(),
				),
			),
			'display_type'                  => array(
				'fields' => array(
					'display_type' => array(),
				),
			),
			'display_type_name_bundle_name' => array(
				'unique' => true,
				'fields' => array(
					'display_type'        => array(
						'sorting' => 'ascending',
					),
					'display_name'        => array(
						'sorting' => 'ascending',
					),
					'display_bundle_name' => array(
						'sorting' => 'ascending',
					),
				),
			),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
	'display_element' => array(
		'fields'         => array(
			'element_name'       => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 255,
				'default' => '',
			),
			'element_weight'     => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 2,
				'default'  => 0,
			),
			'element_data'       => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'element_parent_id'  => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'element_system'     => array(
				'type'    => Application::COLUMN_BOOLEAN,
				'notnull' => true,
				'default' => false,
			),
			'element_element_id' => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'element_id'         => array(
				'autoincrement' => true,
				'type'          => Application::COLUMN_INTEGER,
				'unsigned'      => true,
				'notnull'       => true,
				'length'        => 10,
				'default'       => 0,
			),
			'element_created'    => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'element_updated'    => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'element_display_id' => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'element_id'         => array(
				'primary' => true,
				'fields'  => array(
					'element_id' => array( 'sorting' => 'ascending' ),
				),
			),
			'element_name'       => array(
				'fields' => array(
					'element_name' => array(),
				),
			),
			'element_element_id' => array(
				'fields' => array(
					'element_element_id' => array(),
				),
			),
			'element_display_id' => array( 'fields' => array( 'element_display_id' => array() ) ),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
);
return array(
	'charset'     => '',
	'description' => '',
	'tables'      => $tables,
);
