Skip to content

DACPAC foundation: data-schema project + sprocs + CI/CD build & deploy #8

@rmartinsen-ucd

Description

@rmartinsen-ucd

Create the SDK-style DACPAC project (Microsoft.Build.Sql, default schema data) that owns all domain tables and processing sprocs, and wire it into the existing GitHub Actions pipeline following Walter's pattern.

Implementation

  • Create the .sqlproj with a data schema and folders for tables/sprocs/functions.
  • Build: build the .sqlproj and upload the .dacpac as an artifact.
  • Deploy test (auto on push): sqlpackage /Action:Publish to the test Azure SQL DB using existing SQL_ADMIN_LOGIN/SQL_ADMIN_PASSWORD, with DropObjectsNotInSource=false.
  • Deploy prod (gated): publish a /Action:Script artifact for review, then publish behind the manual deploy_prod / prod Environment gate.

Schema split (DACPAC owns data, EF owns app)

  • DACPAC = data (domain tables + sprocs); EF = app (Run/RunStep/ImportLog control state). Schema prefix is the ownership token.
  • EF confined to app (HasDefaultSchema("app"), app code reads data via Dapper); DACPAC confined to data (DropObjectsNotInSource=false). References point app → data only.
  • Sprocs are parameter-in/results-out, never touch app, and are idempotent (app orchestrates exclusively).
  • CI: fail build if EF migrations reference data. or the .sqlproj references app..

Related: #6 (tables), #7 (import).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions