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.
31 lines (23 loc) • 713 B
text/typescript
import {
Entity,
PrimaryKey,
} from '-orm/core';
import { MikroORM } from '@mikro-orm/mysql';
()
class Article {
()
id!: number;
({ unsigned: false })
someOtherId!: number;
}
test('allow signed primary key when explicitly specified', async () => {
const orm = await MikroORM.init({
dbName: 'mikro_orm_signed_primary_key',
entities: [Article],
connect: false,
});
expect(await orm.schema.getCreateSchemaSQL({ wrap: false })).toBe(
'create table `article` (`id` int unsigned not null, `some_other_id` int not null, primary key (`id`, `some_other_id`)) default character set utf8mb4 engine = InnoDB;\n\n',
);
await orm.close(true);
});