Run Migrations
Setup Migrator
require "cql"
require "../migrations/*"
MyDB.init
config = CQL::MigratorConfig.new(
schema_file_path: "src/schemas/app_schema.cr",
schema_name: :AppSchema,
auto_sync: true
)
migrator = MyDB.migrator(config)Run All Pending Migrations
migrator.up
puts "Migrations complete"Check Migration Status
Run to Specific Version
Create Migration Script
Run From Command Line
Auto-Run on Startup
Verify Migrations Ran
Related
Last updated
Was this helpful?