Skip to content

Instantly share code, notes, and snippets.

@B4nan
Last active June 17, 2019 19:24
Show Gist options
  • Select an option

  • Save B4nan/294405597b6371030ac2ee2e119cf14a to your computer and use it in GitHub Desktop.

Select an option

Save B4nan/294405597b6371030ac2ee2e119cf14a to your computer and use it in GitHub Desktop.
Defining version properties for optimistic locking in MikroORM
export class User {
// ...
@Property({ version: true })
version: number;
// ...
}
export class Book {
// ...
@Property({ version: true })
version: Date;
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment