Define a new schema

I found this link in the documentation The Store Layer :: Corteza Docs

This page says I can simply add a schema in store/rdbms/rdbms_schema.go file but there is no such file.

so how and where do I add a new schema, after adding the schema what are the things I need to regenerate??

Also I dont see generic_upgrades.go file.

Thanks in advance.

1 Like

Looks like we forgot to update the docs; that is not how it works anymore.

The schema is now auto generated; the entry point is here: https://github.com/cortezaproject/corteza/blob/2023.9.x/server/store/adapters/rdbms/upgrade.go#L23

The new generic_upgrades is now here https://github.com/cortezaproject/corteza/blob/2023.9.x/server/store/adapters/rdbms/upgrade_fixes.go#L37


As a side bite; what are you trying to do which would require you to alter the internal schema?

1 Like

Thanks @tjerman for the update.

Actually I was experimenting with the possibility of adding multi-tenancy into the application so that it can used by multiple organisations.

I was wondering, in which files all the schema have been defined??

Can you help me with adding/updating a new schema?

Out of curiosity; what are you gonna be using Corteza for?


Well if you wanna manage the schema via Corteza; the easiest would be if you add a new resource.
Have a look through this commit/resource (dal sensitivity level) โ€“ Expand DAL REST API structure and exposed resources ยท cortezaproject/corteza@ac07f13 ยท GitHub