1. Create the migration in your extension
2. Install an updated version of your extension in your application
3. run rake railties:install:migratiions from your application to copy
the migration from your extension to your application
4. run rake db:migrate from your application
That should create the table you require.
Any time you want to add rows to your table you should do so from your
application.
--
Gregor MacDougall
Sr. Software Developer @ FreeRunning Technologies
(http://www.freerunningtech.com/
)
On Sunday, June 23, 2013 3:34:31 PM UTC-7, obregon cornsnook wrote:
Hi all,
Can anyone please tell me how I create an extension that requires it's own
db table? Based on the extension tutorial at
http://guides.spreecommerce.com/developer/extensions_tutorial.html it
looks like I should create the migration in the spree store and it will be
run when I run the install generator. However, I don't see my new 'offers'
table in the db and my site page gives the following error:
NameError in Spree::HomeController#offers
uninitialized constant Spree::Offer
Also - I need to add a row to this table but do I run rails console from
the store directory, or from the extension directory? The tutorial is
unclear.
Thanks.
Hi all,
Can anyone please tell me how I create an extension that requires it's own
db table? Based on the extension tutorial at
http://guides.spreecommerce.com/developer/extensions_tutorial.html it
looks like I should create the migration in the spree store and it will be
run when I run the install generator. However, I don't see my new 'offers'
table in the db and my site page gives the following error:
NameError in Spree::HomeController#offers
uninitialized constant Spree::Offer
Also - I need to add a row to this table but do I run rails console from
the store directory, or from the extension directory? The tutorial is
unclear.
Thanks.