ORM-24: Add the schema builder core #24
Labels
No labels
area:core
area:database
area:migrations
area:model
area:relations
area:schema
area:tests
breaking-change
size:M
size:S
tracking
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
NoctisWolfshadow/tessera-orm#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Depends on: #9
Context
Raw SQL migrations work, but common DDL is repetitive. The builder is a pure SQL generator: closures run at construction time and the generated SQL is stored in the
Migration, so the checksum covers real SQL and the runner from M2 does not change. Migrations never reference model code, only literal table and column names.Tasks
Schemacollects SQL:create_table(name, |t| ..),drop_table,rename_table,add_column,rename_column,drop_columnandcreate_index(name, table, columns, unique).id(),integer,text,real,boolean,blob, with modifiersnot_null(),unique()anddefault(impl Into<Value>).Migration::schema(version, name).up(|s| ..).down(|s| ..).Example
Generated SQL:
Acceptance criteria
Migratorand produces the expected table according toPRAGMA table_info.