Search Results

Search found 3 results on 1 pages for 'rewbienewbie'.

Page 1/1 | 1 

  • db:migrate creates sequences but doesn't alter table?

    - by RewbieNewbie
    Hello, I have a migration that creates a postres sequence for auto incrementing a primary identifier, and then executes a statement for altering the column and specifying the default value: execute 'CREATE SEQUENCE "ServiceAvailability_ID_seq";' execute <<-SQL ALTER TABLE "ServiceAvailability" ALTER COLUMN "ID" set DEFAULT NEXTVAL('ServiceAvailability_ID_seq'); SQL If I run db:migrate everything seems to work, in that no errors are returned, however, if I run the rails application I get: Mnull value in column "ID" violates not-null constraint I have discovered by executing the sql statement in the migration manually, that this error is because the alter statement isn't working, or isn't being executed. If I manually execute the following statement: CREATE SEQUENCE "ServiceAvailability_ID_seq; I get: error : ERROR: relation "serviceavailability_id_seq" already exists Which means the migration successfully created the sequence! However, if I manually run: ALTER TABLE "ServiceProvider" ALTER COLUMN "ID" set DEFAULT NEXTVAL('ServiceProvider_ID_seq'); SQL It runs successfully and creates the default NEXTVAL. So the question is, why is the migration file creating the sequence with the first execute statement, but not altering the table in the second execute? (Remembering, no errors are output on running db:migrate) Thank you and apologies for tl:dr

    Read the article

  • HTML anchor #bottom, only going half-way down page

    - by RewbieNewbie
    http://www.planet-tolkien.com/board/44/621/0/poll-suggestions It's due to the multiple "bottom of the page" anchor links on each post to the anchor name at the bottom of the page. I tried to solve this by using a unique id and name for the attributes: <a href="#bottom" id="4656" name="4656"> But this hasn't worked. Suggestions? P.S. Don't use the URL bar, yes that works. Visit the page and click on a link in a post that says "Bottom of the page". This is where it isn't working.

    Read the article

1