Skip to content

Commit

Permalink
Fixed slug migration reversion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hulihanapplications committed Jun 2, 2012
1 parent e4079aa commit 4969ff2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Expand Up @@ -69,27 +69,31 @@ Install all of Opal's required gems using bundler:

```sh
cd Opal
bundle install --without development test
bundle install --without test
```

* You may get an error here regarding [magick](http://dev.hulihanapplications.com/wiki/opal/RMagick) if you don't have it already installed. Check out this [Wiki Guide](http://dev.hulihanapplications.com/wiki/opal/RMagick) for help.

## Step 3 - It's time to rake
## Step 3 - Database configurations

Next, edit `config/database.yml` to use your preferred database system. If you don't create this file, one will automatically be generated for you that uses sqlite.

## Step 4 - It's time to rake

Next, Run these commands (while in the Opal directory) to install Opal's required stuff (database structure, assets, etc.) in production mode:

```sh
bundle exec rake db:migrate RAILS_ENV=production LOCALE=en
bundle exec rake db:seed RAILS_ENV=production LOCALE=en
bundle exec rake assets:precompile:nondigest RAILS_ENV=production
bundle exec rake assets:precompile:nondigest

# Install Sample Items, Categories, etc.
bundle exec rake db:sample RAILS_ENV=production LOCALE=en
```

These commands will create the database structure of Opal in production mode. If you leave out *RAILS_ENV=PRODUCTION*, everything will be installed into your development database instead. This will also set up the default admin account, some sample items, and other stuff to help you get started with Opal. You can also specify the *LOCALE* variable to install Opal in a language other than english.

## Step 4 - Fire 'er up
## Step 5 - Fire 'er up

You can now start Opal using the 'thin' webserver...

Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20120205041631_add_side_to_pages.rb
@@ -0,0 +1,5 @@
class AddSideToPages < ActiveRecord::Migration
def change
add_column :pages, :side, :text
end
end
9 changes: 8 additions & 1 deletion db/migrate/20120310123336_add_slug_to_pages.rb
@@ -1,6 +1,13 @@
class AddSlugToPages < ActiveRecord::Migration
def change
def up
add_column :pages, :slug, :string
add_index :pages, :slug, :unique => true
end

def down
remove_column :pages, :slug
remove_index :pages, :slug if index_exists?(:pages, :slug)
# Reset columns so FriendlyID won't break other migrations
Page.reset_column_information
end
end

0 comments on commit 4969ff2

Please sign in to comment.