apply_ddl
¶
Apply every schema and table definition to TimescaleDB.
Files under stock_brokers/instruments/sql/ddl are executed in filename order, so the numeric prefix decides what is
created first - schemas before the tables that live in them. Every statement is written to be
safe to run again, which makes this both the way to create the tables and the way to pick up a
later change to one.
python -m stock_brokers.instruments.sql.apply_ddl
Functions:
| Name | Description |
|---|---|
apply_all |
Execute every DDL file in filename order. |
main |
Apply the DDL and report how many files were run. |
apply_all
¶
Execute every DDL file in filename order.
The whole run is one transaction: a broken definition rolls the batch back rather than leaving the database half migrated.
directoryis the folder holding the.sqlfiles.