Feature deep dive

Physical model: the design as scripts your team can run

Turn the approved logical design into DDL for your platform, check it before anyone runs it, and plan the change script for a warehouse already in production. Model One writes the scripts; your team runs them.

Columns tab with Sales Order expanded: the table name override sales_order, the per-column grid, and chips for type overrides, custom SQL, index tuning and a check
Overview

Technical design, derived from the specification

A physical model is the logical design realised for one database platform, not a second model kept beside it.

Hand-translating a logical model into tables is where design and database drift apart. In Model One a physical model is derived from the logical model: entities become tables, attributes become columns and relationships become foreign keys. You record only what differs on the platform — a table name, a native type, a key strategy — and the rest keeps following the design.

Keep a physical model for each target — a Microsoft Fabric Data Warehouse, a SQL Server database, or both from one design — each with its own naming standard, overrides and scripts. The physical model you pick in the Flow dbt export also names the tables and schemas it reads and loads, and decides the adapter: dbt-fabric for a Fabric model, dbt-sqlserver for a SQL Server one.

Model One never connects to your database. It produces the CREATE script and the migration script; you review them and run them with the tools you already use, then record which version each database is on, or let a promotion on the Environments tab record it when the promotion is marked deployed.

Walkthrough

From approved design to a schema you can deploy and maintain

Six steps, from choosing a platform to changing a warehouse that already holds data.

Step 1

Choose the target platform

Create a physical model with a name, a target database and a schema, and Model One derives its tables, columns and foreign keys from the logical model. Microsoft Fabric Data Warehouse is a target of its own, not a flavour of SQL Server: the warehouse accepts a smaller set of table features, and the script follows them. Taking over an existing database? Import its DDL instead. Model One says which database it detected and offers to build the physical model with the types the script declared.

  • SQL Server, Microsoft Fabric Data Warehouse, PostgreSQL, Oracle or MySQL
  • Tables, columns and foreign keys derived from the logical model
  • Several physical models from one design, e.g. Fabric and SQL Server
  • DDL import keeps native types, lengths, defaults and CHECK constraints
New Physical Model dialog with a name, the target database set to SQL Server and the schema dbo
Step 2

Shape tables and names to your standard

Logical datatypes map to each platform's native types; record an override only where a name or type should differ. Choose how surrogate keys are generated on each platform, and leave out a table that does not belong in this database. A naming standard states your house rules once per physical model and checks every emitted name. It proposes and previews renames, nothing is renamed until you apply them, and a deliberate exception is recorded with its reason.

  • Table, schema and column name overrides, used exactly as typed
  • Native types from a per-platform type picker, and nullability per column
  • Surrogate keys per target: IDENTITY, SEQUENCE, BIGSERIAL, AUTO_INCREMENT or UUID
  • Naming standard off, monitored or enforced: casing, F_ / D_ / H_ prefixes, length limits
  • Approved abbreviations from the Data Dictionary, class words such as _DT, banned words
Columns tab with Sales Order expanded: the table name override sales_order, the per-column grid, and chips for type overrides, custom SQL, index tuning and a check
Step 3

Complete the schema

A production schema needs more than tables and keys. Indexes are defined once on the entity and tuned per platform, and an option the database lacks is disabled and labelled as not supported. Add CHECK constraints and ON DELETE / ON UPDATE actions, put your own SQL where the generator does not reach — a GRANT for the reporting role, seed data — and carry your definitions into the database as comments.

  • Index tuning per platform: method, INCLUDE columns, filter and clustered where supported
  • CHECK constraints and ON DELETE / ON UPDATE actions on foreign keys
  • Your own SQL in four slots: script header and footer, before and after each table
  • Table and column comments from entity and dictionary term definitions
Sales Order table with a trailing GRANT for a reporting role, index tuning where Method is disabled as not supported on SQL Server, and a CHECK constraint
Step 4

Generate the script and check it before you deploy

Generate the CREATE script for the whole model or a single table. The DDL tab lists what the target database would reject — a foreign key whose column types differ, a name longer than the platform allows, a surrogate strategy it cannot honour — and each finding opens the entity where it is fixed.

  • Whole-model or single-table script to copy or download as a .sql file
  • Every identifier quoted for the dialect, so reserved words such as Order still work
  • Errors for what the database would reject, warnings worth reading, each naming its object
  • Optional guards that skip existing objects, to finish a partial deployment where the database allows
  • An enforced naming standard holds generation until each error is fixed or waived
DDL tab of the Production SQL Server model: the generated SQL Server script for the order-to-cash tables, ready to copy or download
Step 5

Generate for Fabric Data Warehouse from the same design

The Sales Mart model targets Microsoft Fabric Data Warehouse from the same logical model as the SQL Server one, and holds only the four mart tables. Its script uses only what the warehouse accepts: primary and unique keys are added after each table as NONCLUSTERED constraints, every key is marked NOT ENFORCED, and the D_ and F_ table names come from table-name overrides. Anything a Fabric model holds but cannot carry is reported, never dropped silently.

  • Primary and unique keys as ALTER TABLE … NONCLUSTERED … NOT ENFORCED after each table
  • Foreign keys NOT ENFORCED, so without ON DELETE or ON UPDATE actions
  • Surrogate keys as a bare BIGINT IDENTITY, and text as varchar, since the warehouse stores UTF-8
  • No indexes, defaults, CHECK constraints or comments, which the warehouse does not support
  • Table-name overrides such as D_PRODUCT and F_SALES, and the tables that do not belong excluded
DDL tab of the Sales Mart — Fabric Warehouse model (Fabric Data Warehouse, schema mart): CREATE TABLE for D_PRODUCT, with a BIGINT IDENTITY key, and for F_SALES, each followed by ALTER TABLE statements that add its keys as NOT ENFORCED constraints: a primary and a unique key on D_PRODUCT, a primary key and foreign keys on F_SALES
Step 6

Migrate the database that is already in production

A CREATE script is the wrong tool for a warehouse that already holds data. On the Migrations tab, pick the version the target database runs and where it should end up, and Model One writes the ordered ALTER statements between them. A rename stays a rename, so a table keeps its rows and a renamed column keeps its keys. Each step is labelled safe, lossy or blocking; anything not safe is commented out until you confirm it. After your team runs the script, record the deployment so the next plan starts from the right version. A promotion on the Environments tab plans this migration for each target database of a stage, and records the deployment when it is marked deployed.

  • Ordered ALTER script from the deployed version to a later version or today's model
  • A key taken off for a change is put back in the same script, as one change
  • Safe, lossy and blocking steps; risky ones commented out until you confirm them
  • Changed custom SQL shown side by side, each snippet included only when you tick it
  • Deployment history per target database: which version, when, by whom, with a note

Versions & audit

Migrations tab planning from v4 to the current model: five steps, 4 safe and 1 lossy, with the lossy drop of legacy_ref commented out and the safe step creating the invoice and dim_customer tables ready to run
Highlights

What makes the scripts dependable

Repeatable rules, stated limits, and nothing run behind your back.

Fabric as a dialect of its own

Fabric Data Warehouse scripts use only what the warehouse accepts, and anything a Fabric model holds but cannot carry is reported, never dropped silently.

Checked before anyone runs it

Type mismatches, partial composite keys, over-long names and unsupported key strategies are named before the script reaches your DBA.

Standards without surprise renames

Monitor or enforce your naming rules. Renames are proposed and previewed, then applied as overrides with a snapshot taken first.

Scripts, not a connection

Model One never connects to your database. Your team reviews the DDL and migration scripts and runs them with its own tools.

Keep exploring

Where the physical model fits

It sits between the reviewed design and the loads and releases that follow it.

Generate a schema from your own design

Bring a model, or the DDL of a database you already have, and we will generate the SQL Server or Fabric script and plan a migration with you in one session.