undeexcepturi
Version:
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
37 lines (25 loc) • 668 B
text/typescript
import { Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/postgresql';
()
class A {
()
id!: number;
({ default: -1 })
foo!: number;
({ default: 'baz' })
bar!: string;
}
describe('GH issue 380', () => {
let orm: MikroORM;
beforeAll(async () => {
orm = await MikroORM.init({
entities: [A],
dbName: `mikro_orm_test_gh_380`,
});
await orm.schema.refreshDatabase();
});
afterAll(() => orm.close(true));
test(`schema updates respect default values`, async () => {
const dump = await orm.schema.getUpdateSchemaSQL({ wrap: false });
expect(dump).toBe('');
});
});