We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated TypeOrm migration references missing typeorm_metadata table when a generated column is added
typeorm_metadata table is created the first time it is needed (e.g. a view or generated column is added)
typeorm_metadata table is created the first time it is needed only if a view is added, not a generated column
Generated migration file is something like:
import { MigrationInterface, QueryRunner } from "typeorm"; export class Test1732259899196 implements MigrationInterface { name = 'Test1732259899196' public async up(queryRunner: QueryRunner): Promise<void> { await queryRunner.query(`ALTER TABLE "<my schema>"."<my table>" ADD "<my generated column>" <datatype> GENERATED ALWAYS AS ( <implementation> ) END ) STORED`); await queryRunner.query(`INSERT INTO "<my db>"."typeorm_metadata"("database", "schema", "table", "type", "name", "value") VALUES ($1, $2, $3, $4, $5, $6)`, ["<my db>","<my schema>","<my table>","GENERATED_COLUMN","<my generated column>","<implementation>"]); } ... }
As you can see, there is no creation of typeorm_metadata table before insertion of the new row, which causes the migration to fail
typeorm_metadata
Similar to #4923, but for virtual columns instead of views
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue description
Generated TypeOrm migration references missing typeorm_metadata table when a generated column is added
Expected Behavior
typeorm_metadata table is created the first time it is needed (e.g. a view or generated column is added)
Actual Behavior
typeorm_metadata table is created the first time it is needed only if a view is added, not a generated column
Generated migration file is something like:
As you can see, there is no creation of
typeorm_metadata
table before insertion of the new row, which causes the migration to failSteps to reproduce
typeorm_metadata
table does not exist)My Environment
Additional Context
Similar to #4923, but for virtual columns instead of views
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
The text was updated successfully, but these errors were encountered: