views:

27

answers:

2

I created a small sqlite database on my laptop and it has several records:

sqlite> .dump 
PRAGMA foreign_keys=OFF; 
BEGIN TRANSACTION; 
CREATE TABLE "bus_bingo_tile_templates" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "title" VARCHAR(50), "alt" VARCHAR(50), "image_filename" VARCHAR(50), "enabled" BOOLEAN); 
INSERT INTO "bus_bingo_tile_templates" VALUES(26,'bed','I took a nap.','nap.gif',1); 
INSERT INTO "bus_bingo_tile_templates" VALUES(27,'bicyle','Saw someone put a bike on the bus..','bike.gif',1); 
INSERT INTO "bus_bingo_tile_templates" VALUES(28,'books','I read a book.','book.gif',1); 
... 

But when I try to upload it to Heroku, the result is "0 tables, 0 records":

$ heroku db:push sqlite:busbingo.db 
Loaded Taps v0.3.11 
Warning: Data in the app 'busbingo' will be overwritten and will not be recoverable. 
Are you sure you wish to continue? (y/n)? y 
Sending schema 
Schema: 100% |==================================================================================| Time: 00:00:00 
Sending data 
0 tables, 0 records 
Resetting sequences

Someone submitted to StackOverflow.com that he succeed in uploading a sqlite database to Heroku by converting it to a schema.rb file, but I don't know how to do this (I have experience only with Sinatra and DataMapper).

A: 

Let's start with some sanity checks. Can you print out the actual value of the "schema" variable as received by Heroku?

MPelletier
Thanks. See my own answer below.
lsiden
A: 

My bad: I was pushing to the wrong refspec. The correct refspec for Heroku (at least for me) is +HEAD:refs/heads/master.

lsiden
No problem. I have no idea what you found, but I'm glad you did.
MPelletier