DDL scripts

Hello,

I just started using Axon and I am curious where can I find DDL scripts for ALL the tables that Axon needs? I found DDL statements in code but it is a pain to extract those statements and I really do not know which tables are needed.

I found:

  • Event table
  • Token table
  • Saga table

Are there more?

Hi Rene,

You probably missed the SnapshotEntry (to snapshot your aggregates) and the AssociationValueEntry (associates a Saga instance to event keys) tables.
So that makes 5 Axon Framework tables in total.

By the way, I typically let those tables be created by the Framework itself.
Not sure why we’re not providing direct DDL scripts, hope Allard could give some feedback on that.

Hope this helps!

Cheers,

Steven

Yes I found other tables after I posted the question. But thanks.

For now I used Framework to generate tables and thed generate DDL from database.

Hi Rene,

the reason we don’t have the DDL script yet, is because when we do provide them, we want them to be optimized correctly for that type of database. We just didn’t find the time (priority) yet. Until then, having your ORM framework (like Hibernate) generate the tables for you is the easiest way forward. You can then generate the DDL scripts from the tables. I would recommend optimizing some of the tables first and giving indices proper names, for easier debugging.

Cheers,

Allard

I know I’m a bit late joining this conversation. We use liquibase to programmatically create the schema. Here is a project where we’ve done this: https://github.com/project-tungsten/tungsten-reference-apps/tree/master/reference-domain-service/src/main/resources/db

Hope you find it useful.