Shopify's ORM migration system runs hundreds of database migration scripts on deploy. A migration can depend on another (e.g., "AddOrderIndex" needs "CreateOrdersTable" to run first). A developer accidentally created a circular dependency, causing the migration runner to deadlock. The system must detect cycles before starting any migrations.
Our ORM runs database migration scripts. A script can require another script to run first (e.g., `AddUsersTable` depends on `EnableUUIDExtension`). Determine if all scripts can execute successfully, or if there is a circular dependency dead-locking the system.
βΆ Run Code to test against examples Β· Submit to judge all 5 test cases