<?php
namespace PortalPeople\DisabledDates\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface
{
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();
        if (!$setup->tableExists('portalpeople_disabled_dates')) {
            $table = $setup->getConnection()->newTable(
                $setup->getTable('portalpeople_disabled_dates')
            )
            ->addColumn(
                'entity_id',
                Table::TYPE_INTEGER,
                null,
                ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
                'ID'
            )
            ->addColumn(
                'date',
                Table::TYPE_DATE,
                null,
                ['nullable' => false],
                'Disabled Date'
            )
            ->addColumn(
                'description',
                Table::TYPE_TEXT,
                255,
                ['nullable' => true],
                'Description'
            )
            ->setComment('PortalPeople Disabled Dates');
            $setup->getConnection()->createTable($table);
        }
        $setup->endSetup();
    }
}
