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
Describe the bug
Unexpected default for generated entity with boolean property
To Reproduce
Steps to reproduce the behavior:
CREATE TABLE `test_table` ( `test_column` tinyint(1) not null default 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ts-node generateEntities.ts
import { MikroORM } from '@mikro-orm/core'; (async () => { const orm = await MikroORM.init({ discovery: { // we need to disable validation for no entities warnWhenNoEntities: false, }, dbName: dbName .... }); const generator = orm.getEntityGenerator(); const dump = await generator.generate({ save: true, baseDir: process.cwd() + '/my-entities', }); console.log(dump); await orm.close(true); })();
Expected behavior
I would expect the generated entity to have a boolean property defaulting to False but the property is actually defaulting to True.
False
True
This is the actual autogenerated entity
import { Entity, Property } from '@mikro-orm/core'; @Entity() export class TestTable { @Property() testColumn: boolean = true; }
The text was updated successfully, but these errors were encountered:
908a638
fix(entity-generator): fix boolean default values
219fc0c
Closes #1917
B4nan
No branches or pull requests
Describe the bug
Unexpected default for generated entity with boolean property
To Reproduce
Steps to reproduce the behavior:
ts-node generateEntities.ts
Expected behavior
I would expect the generated entity to have a boolean property defaulting to
False
but the property is actually defaulting toTrue
.This is the actual autogenerated entity
The text was updated successfully, but these errors were encountered: