shki bootstrap
shki bootstrap [NAME] [--dry-run] [--force] [--schema NAME]Alias: shki strap. For projects whose database predates shki. It introspects a
live database (use dev or staging) and writes the artifacts that describe its
current shape as the starting point of history: the initial migration, its
Snapshot, a Directory Schema, and the Journal entry. NAME defaults to
bootstrap.
Options
Section titled “Options”| Flag | Purpose |
|---|---|
--dry-run | Show what would be generated without writing files. |
--force | Run even when migrations or Snapshots already exist locally. |
--schema <NAME> | Schema to bootstrap (PostgreSQL, default public). |
-u, --database-url <URL> | Database to introspect. Env: DATABASE_URL. |
Examples
Section titled “Examples”shki bootstrap --dry-run # inspect the plan firstshki bootstrap # write the baselineshki bootstrap initial --schema billing # name it, non-default schemaAfter bootstrapping
Section titled “After bootstrapping”Commit everything it wrote. From then on the original database is no longer
special — evolve the schema with shki generate and
shki create as normal.
Deployment depends on the target environment’s state:
shki adopt # environment already has the baseline schemashki migrate # brand-new/empty environment: runs the baseline like any migrationSee also: shki adopt,
Adopt an existing database.