How do I use migrations to create a postgres sequence?
I have created a migrations file with the following executes:
execute 'CREATE SEQUENCE "ServiceAvailability_ID_seq";'
execute <<-SQL
ALTER TABLE "ServiceAvailability"
ALTER COLUMN "ID" set DEFAULT NEXTVAL("ServiceAvailability_ID_seq")
SQL
However, when running rake db:migrate I'm getting the following error:
PGError: ERROR: column "ServiceAvailability_ID_seq" does not exist : ALTER TABLE "ServiceAvailability" ALTER COLUMN "ID" set DEFAULT NEXTVAL("ServiceAvailability_ID_seq")
Second question, rake db:schema:dump is meant to create a file that can be portably used against any DB, however, on investigating a schema:dump it appears to only include table, field and field type information and misses out indexes and sequences?