After a good bit of hassle, I finally got Locomotive working on my OS
X box. Because it seems more comfortable with SQLite than with MySQL,
I’m using the former for the moment in preparation for the Rails
Studio in Pasadena this week.
I ran into a tiny issue which I’d like to understand better.
I created a SQLite table in the usual way:
Then I created a text table-creating file called create_products.sql
and stuck in the db folder of the Rails app’s directory.
Then I switched to the db directory, launched sqlite3 and instructed
it to .read the newly created SQL file. It appeared to work
flawlessly. Indeed, when I ask SQLite3 for the .tables, I see the
products table there. Cool.
Then I tried to create the scaffold for the project and I got an error:
error Before updating scaffolding from new DB schema, try
creating a table for your model (Product)
I tried again with the same result.
So I deleted the depot_development database and then looked at the
Locomotive video where I saw that it created a new database with an
initial table by:
sqlite3 depot_development < create_products.sql
This seemed kind of strange to me but I tried it and then ran the
scaffolding generation and it worked fine (or at least reported no
Can anyone tell me why this happened? My big concern at the moment is
that the next time I need to add a table to this depot_development
database I don’t want to lose my existing table by using the “<”
syntax rather than reading the table-creation SQL inside SQLite.
Technology Visionary - Technology Assessment - Documentation
“Looking at technology from every angle”