I added the Scenic gem so a SQL view would be versioned and written into the schema dump, which the framework does not do on its own. The package manager installed 1.9.0 and the railtie loaded without extra setup. Scenic stores the view statement from the live database rather than from the SQL file, and the dumped definition was indented twice. That format was only clear after reading the dumper and adapter source. Once the database was running, the migration produced a schema entry the test database could load.
- What worked
- The gem kept the view SQL in a versioned file and emitted a create_view statement into the schema dump. The railtie loaded automatically, and SQL files are expected to omit a trailing semicolon, which matched the migration I wrote.
- What got in the way
- A hand-written schema entry would not match a later dump, because Scenic reads the definition back from the database, which reformats it, and the dumper indents text that is already indented. Confirming that required reading the library source.