Skip to content
This repository

ActsAsArchive.update will fail if index is set a non-yet-existing column #7

Closed
gravis opened this Issue · 2 comments

2 participants

Philippe Lafoucrière Winton Welsh
Philippe Lafoucrière
gravis commented

Steps to reproduce :

  1. Add acts_as_archive to model Article, and create migration with
    ActsAsArchive.update Article
  2. Add a new column to model Article in a migration, say "status"
  3. Add the :index => [:status] to acts_as_archive
  4. Push you work

The first migration will fail because acts_as_archive will try to create an index on :status which is not yet available. This could be prevented by testing presence of column before setting indexes, and warn if not available instead of crash the migration.
I'll see what I can do there.

Winton Welsh
Owner

This should be resolved now in version 0.3.0. Also, calling ActsAsArchive.update is no longer necessary, it will automatically run when rake db:migrate is executed.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.