SchemaHero is a Kubernetes Operator that implements a new custom kind:
Table kind defines a database table, along with columns, type, indices and constraints. The
Table object can be deployed to a cluster that has the SchemaHero operator installed. When the SchemaHero operator receives a
Table object, it will query the target database for the current schema, if any.
Once SchemaHero has the current schema, it can determine how to apply the
Table YAML by creating a
Migration. For example, if the table does not already exist in the database, SchemaHero will translate the
Table YAML into a
CREATE TABLE statement and create a pending
Migration. Alternatively, if the table already exists, SchemaHero will diff the columns, types, indices and constraints of the current table with the desired table and create an
ALTER TABLE statement. SchemaHero will then deploy a pending
Migration with the
ALTER TABLE statement agsinst the target database.
SchemaHero is a Kubernetes Operator that manages database schema migrations as code. You can create a table and then modify the table, columns, indexes and other properties by editing the table definition. SchemaHero handles the process of comparing the desired schema to the running schema and then building and executing SQL statements to migrate.