Skip to content

Instantly share code, notes, and snippets.

@mingliangfeng
Last active December 15, 2015 21:29
Show Gist options
  • Select an option

  • Save mingliangfeng/5325929 to your computer and use it in GitHub Desktop.

Select an option

Save mingliangfeng/5325929 to your computer and use it in GitHub Desktop.
RefineryCMS
# how to add a migration to an extension
1. Under app folder:
> rails g migration add_a_field_to_a_table ...
2. Copy this migration from app db/migrate folder to extension db/migrate folder and rename the file:
> mv db/migrate/1222_add...rb <extension's db/migrate>
> # then rename the migration file to #_add...
3. still on app folder, run the following command to copy the migrate from extension to app:
> rake refinery_<extension name>:install:migrations
4. still on app folder, run:
> [RAILS_ENV=development] rake db:migrate
> rake db:migrate development
5. insert scaffold to existing extension:
> rails generate refinery:engine user provider:string uid:string name:string --extension clients --namespace clients --skip-frontend -s -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment