Skip to main content

Module schema

Module schema 

Source
Expand description

Build CREATE TABLE, CREATE TYPE, and related schema statements from Entity definitions.

Use Schema::new with a DbBackend to get a helper, then call Schema::builder for a fluent SchemaBuilder that emits sea_query statements you can execute on a connection. With the entity-registry and schema-sync feature flags enabled, db.get_schema_registry(prefix) syncs all registered entities at once.

Structsยง

EntitySchemaInfo
Schema info for Entity. Can be used to re-create schema in database.
Schema
Helper that converts an EntityTrait into different sea_query statements (CREATE TABLE / CREATE TYPE / etc) for a given DbBackend.
SchemaBuilder
A schema builder that can take a registry of Entities and synchronize it with database.