{"record":{"id":"40fac18333d2c77f","repo":"octobercms/october","slug":"blueprint-get-class-blueprint-does-not-use-a-d","errorCode":null,"errorMessage":"Blueprint [get_class($blueprint)] does not use a database table.","messagePattern":"Blueprint \\[get_class\\(\\$blueprint\\)\\] does not use a database table\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/tailor/classes/SchemaBuilder.php","lineNumber":134,"sourceCode":"    public static function migrateBlueprint(Blueprint $blueprint, Fieldset $fieldset)\n    {\n        $builder = new self;\n        $builder->initBlueprint($blueprint, $fieldset);\n        return $builder->migrate();\n    }\n\n    /**\n     * initBlueprint\n     */\n    public function initBlueprint(Blueprint $blueprint, Fieldset $fieldset)\n    {\n        $this->fieldset = $fieldset;\n        $this->blueprint = $blueprint;\n        $this->tableName = $blueprint->getContentTableName();\n        $this->tableBlueprint = $this->makeDatabaseBlueprint($fieldset);\n\n        if (!$this->tableName) {\n            throw new SystemException('Blueprint ['.get_class($blueprint).'] does not use a database table.');\n        }\n\n        $this->tableExists = Schema::hasTable($this->tableName);\n        $this->tableColumns = $this->tableExists ? Schema::getColumnListing($this->tableName) : [];\n    }\n\n    /**\n     * migrate\n     */\n    public function migrate()\n    {\n        $this->actionCount = 0;\n\n        $this->migrateFields();\n        $this->migrateJoins();\n        $this->migrateRepeaters();\n        $this->migrateTablePatches();\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/classes/SchemaBuilder.php#L116-L152","documentation":"SchemaBuilder::initBlueprint() prepares a content table for a blueprint, starting from $blueprint->getContentTableName(). When that method returns an empty value (blueprint kinds that store no content of their own, e.g. mixins), the builder has no table to migrate and throws a SystemException.","triggerScenarios":"Passing a mixin blueprint (or any blueprint whose getContentTableName() is null) into SchemaBuilder::initBlueprint()/migrate() — typically from custom commands or scripts that iterate every blueprint from the indexer and schema-build each one indiscriminately.","commonSituations":"Custom migration/import tooling looping over all blueprints; new blueprint kinds introduced without content tables; code assuming every blueprint is content-bearing.","solutions":["Skip blueprints without a content table before building: `if (!$blueprint->getContentTableName()) continue;`","Only schema-build content-bearing types (entry, stream, structure, single, global) and let Tailor's own refresh (`php artisan tailor:refresh`) handle the rest."],"exampleFix":"// before\nforeach ($blueprints as $blueprint) {\n    $builder->initBlueprint($blueprint, $fieldset);\n}\n\n// after\nforeach ($blueprints as $blueprint) {\n    if (!$blueprint->getContentTableName()) {\n        continue;\n    }\n    $builder->initBlueprint($blueprint, $fieldset);\n}","handlingStrategy":"validation","validationCode":"if (!$blueprint->getContentTableName()) {\n    continue; // mixin-style blueprint: no table to build\n}\n$schemaBuilder->initBlueprint($blueprint, $fieldset);","typeGuard":"function isTableBackedBlueprint(\\Tailor\\Classes\\Blueprint $blueprint): bool\n{\n    return (bool) $blueprint->getContentTableName();\n}","tryCatchPattern":"try {\n    $builder->initBlueprint($blueprint, $fieldset);\n} catch (\\SystemException $e) {\n    // blueprint has no content table (e.g. mixin); skip it in custom tooling\n}","preventionTips":["In custom scripts that iterate blueprints, filter out table-less blueprints before schema building.","Prefer `php artisan tailor:refresh` over hand-rolled schema building; it handles all blueprint kinds correctly."],"tags":["tailor","schema-builder","mixin","api-misuse"],"backgroundTag":"unsupported-operation-for-type","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}