Loads and applies ordered SQL migrations from an embedded file system in Go.
// Source: https://github.com/hoangsonww/AegisVision-Computer-Vision-System | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works // Provided via justclaw.it.com; keep this notice with the code. // Package migrate runs ordered SQL migrations against a sql.DB. // // Migrations are embedded into each service (typically via go:embed) and // applied at startup. Each migration is one file; the filename starts with // a zero-padded numeric prefix (e.g. 0001_create_pipelines.sql). A single // `schema_migrations` table tracks applied versions. // // Migrations are applied within a single transaction per file — partial // success isn't a thing. Failures abort startup, which is the correct // posture for a control-plane service. package migrate import ( "con ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key