<?php
use SabaiApps\Directories\Application;

$tables = array(
	'entity_bundle'      => array(
		'fields'         => array(
			'bundle_name'            => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'bundle_type'            => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'bundle_component'       => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'bundle_info'            => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'bundle_entitytype_name' => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'bundle_group'           => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'bundle_created'         => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'bundle_updated'         => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'bundle_name'            => array(
				'primary' => true,
				'fields'  => array(
					'bundle_name' => array( 'sorting' => 'ascending' ),
				),
			),
			'bundle_component'       => array(
				'fields' => array(
					'bundle_component' => array(),
				),
			),
			'bundle_group'           => array(
				'fields' => array(
					'bundle_group' => array(),
				),
			),
			'bundle_entitytype_name' => array(
				'fields' => array(
					'bundle_entitytype_name' => array(
						'sorting' => 'ascending',
					),
				),
			),
			'bundle_type'            => array(
				'fields' => array(
					'bundle_type' => array(
						'sorting' => 'ascending',
					),
				),
			),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
	'entity_fieldconfig' => array(
		'fields'         => array(
			'fieldconfig_name'            => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'fieldconfig_type'            => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'fieldconfig_system'          => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 2,
				'default'  => 0,
			),
			'fieldconfig_settings'        => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'fieldconfig_property'        => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'fieldconfig_schema'          => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'fieldconfig_schema_type'     => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
			'fieldconfig_entitytype_name' => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'fieldconfig_bundle_type'     => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'fieldconfig_created'         => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'fieldconfig_updated'         => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
		),
		'indexes'        => array(
			'fieldconfig_name'            => array(
				'primary' => true,
				'fields'  => array(
					'fieldconfig_name' => array( 'sorting' => 'ascending' ),
				),
			),
			'fieldconfig_system'          => array(
				'fields' => array(
					'fieldconfig_system' => array(),
				),
			),
			'fieldconfig_entitytype_name' => array(
				'fields' => array(
					'fieldconfig_entitytype_name' => array(
						'sorting' => 'ascending',
					),
				),
			),
			'fieldconfig_bundle_type'     => array(
				'fields' => array(
					'fieldconfig_bundle_type' => array(
						'sorting' => 'ascending',
					),
				),
			),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
	'entity_field'       => array(
		'fields'         => array(
			'field_data'             => array(
				'type'    => Application::COLUMN_TEXT,
				'notnull' => true,
			),
			'field_id'               => array(
				'autoincrement' => true,
				'type'          => Application::COLUMN_INTEGER,
				'unsigned'      => true,
				'notnull'       => true,
				'length'        => 10,
				'default'       => 0,
			),
			'field_created'          => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'field_updated'          => array(
				'type'     => Application::COLUMN_INTEGER,
				'unsigned' => true,
				'notnull'  => true,
				'length'   => 10,
				'default'  => 0,
			),
			'field_bundle_name'      => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 40,
				'default' => '',
			),
			'field_fieldconfig_name' => array(
				'type'    => Application::COLUMN_VARCHAR,
				'notnull' => true,
				'length'  => 50,
				'default' => '',
			),
		),
		'indexes'        => array(
			'field_id'               => array(
				'primary' => true,
				'fields'  => array(
					'field_id' => array( 'sorting' => 'ascending' ),
				),
			),
			'field_bundle_name'      => array( 'fields' => array( 'field_bundle_name' => array() ) ),
			'field_fieldconfig_name' => array( 'fields' => array( 'field_fieldconfig_name' => array() ) ),
		),
		'initialization' => array(
			'insert' => array(),
		),
	),
);
return array(
	'charset'     => '',
	'description' => '',
	'tables'      => $tables,
);
