Minor Changes
-
BREAKING CHANGE: Migrations are now plain SQL files
Migrations are directories named
YYYYMMDDHHmmss_<slug>/containing a hand-writtenup.sql(required) and an optionaldown.sql. The runner sends each script to the adapter as a single multi-statement query and journals it on success.Removed APIs (
remix/data-table/migrations)createMigrationMigrationContext,MigrationSchema,AlterTableBuilder,CreateMigrationInput,Migration,KeyColumns,TableInputparseMigrationFilename(replaced byparseMigrationDirectoryName)- The
column/ColumnBuilderre-exports fromremix/data-table/migrations(still available from the mainremix/data-tableentry)
Changed APIs
MigrationDescriptoris now{ id, name, up: string, down?: string, transaction?, path? }. Checksums are alwayssha256(up), computed by the runner.MigrateResult.sqlisstring[]instead ofSqlStatement[]loadMigrations(directory)scans folder-per-migration layouts (not.tsfiles) and returns descriptors with SQL stringsDatabaseAdaptergained a requiredexecuteScript(sql, transaction?)method; existing first-party adapters implement it natively- Removed
migrate(request)and theDataMigrationOperationADT (CreateTableOperation,AlterTableOperation,*Change,IndexDefinition,*Constraint, etc.) fromDatabaseAdapterand the public exports.compileSqlnow accepts onlyDataManipulationOperation. Migration journal table creation moved to portable SQL insidejournal-store.ts.isDataManipulationOperationremoved fromremix/data-table/sql-helpers.
Transaction Modes
Migrations still run inside an adapter transaction by default. Override per migration with a directive on a
--line ofup.sql:-- data-table/transaction: none create index concurrently users_email_idx on users (email);
Modes are
auto(default),required, andnone. The mode can also be set explicitly on aMigrationDescriptorvia thetransactionfield.Migrating From the Schema-Builder API
Replace each
createMigration({ async up({ schema })... })file with a directory containing the equivalent SQL:db/ migrations/ 20260301113000_add_user_status/ up.sql down.sql