public function getTableSchema()
    {
        return \Cache::rememberForever('model:' . $this->table, function () {
            $resourceName = $this->table;
            $name = $resourceName;
            if (empty($schemaName = $this->getDefaultSchema())) {
                $internalName = $resourceName;
                $quotedName = $this->getSchema()->quoteTableName($resourceName);;
            } else {
                $internalName = $schemaName . '.' . $resourceName;
                $quotedName = $this->getSchema()->quoteTableName($schemaName) . '.' . $this->getSchema()->quoteTableName($resourceName);;
            }
            $settings = compact('schemaName', 'resourceName', 'name', 'internalName', 'quotedName');
            $tableSchema = new TableSchema($settings);
            $tableSchema = $this->getSchema()->getResource(DbResourceTypes::TYPE_TABLE, $tableSchema);
            // merge db relationships
            if (!empty($references = $this->getTableConstraints())) {
                $this->updateTableWithConstraints($tableSchema, $references);
            }

            $tableSchema->discoveryCompleted = true;

            return $tableSchema;
        });
    }