<?php
namespace SabaiApps\Directories\Component\Field\Type;

use SabaiApps\Directories\Application;

trait StringSchemaTypeTrait {

	public function fieldTypeSchemaType( $type, $name ) {
		return 'string';
	}

	public function fieldTypeSchema( array $settings = array() ) {
		return array(
			'columns' => array(
				'value' => array(
					'type'    => Application::COLUMN_VARCHAR,
					'length'  => 255,
					'notnull' => true,
					'was'     => 'value',
					'default' => '',
				),
			),
			'indexes' => array(
				'value' => array(
					'fields' => array(
						'value' => array(
							'sorting' => 'ascending',
							'length'  => 191,
						),
					),
					'was'    => 'value',
				),
			),
		);
	}
}
