Forum: Radiant CMS I'm confused.

43555bf4a37376d15100caf27151f15e?d=identicon&s=25 Marc (Guest)
on 2010-12-07 03:14
(Received via mailing list)
Hi All,

If I have a site with a number of extensions installed and I had to
drop the database and want to reinitialise it what are the steps?

I've tried
  rake production db:bootstrap --trace

which fails due to missing columns that are part of various
extensions.

I've tried
  rake production db:migrate

after to try and fix that, but the admin pages seem to disallow any
activity that would change the database

Regards,

Marc
09477c358c5897d44121a248326e16d7?d=identicon&s=25 Jim Gay (Guest)
on 2010-12-07 03:24
(Received via mailing list)
On Mon, Dec 6, 2010 at 9:14 PM, Marc <marc.boschma@gmail.com> wrote:
>
> I've tried
> rake production db:migrate
>
> after to try and fix that, but the admin pages seem to disallow any
> activity that would change the database
>
> Regards,
>
> Marc
>

Here's the short answer: move your extensions into a different
directory, bootstrap, and then move them back and migrate the
extensions

It probably depends on your extensions.
Some are written blindly updating the existing models with assumptions
that the database exits.
An extension might add a column to the database and
validate_presence_of for that column, for example.
Some extensions might be fine, and others kill bootstrapping. So its
easier to just bootstrap without any of them, and then add them back.
43555bf4a37376d15100caf27151f15e?d=identicon&s=25 Marc (Guest)
on 2010-12-07 03:46
(Received via mailing list)
Thanks Jim!

rake production db:migrate:extensions

didn't seem to get the job done - I think there is a dependancy
between some of the extensions (copy_move, dashboard, page_preview,
paperclipped, ray, reorder, settings, sns, sns_minifier). Funny enough
if I do

foreach extension (*) # in vendor/extensions
  (cd ../.. ; rake radiant:extensions:${extension}:migrate)
end

I get the right result.

I also did:

foreach extension (*) # in vendor/extensions
  (cd ../.. ; rake radiant:extensions:${extension}:update)
end

just in case.
09477c358c5897d44121a248326e16d7?d=identicon&s=25 Jim Gay (Guest)
on 2010-12-07 03:53
(Received via mailing list)
On Mon, Dec 6, 2010 at 9:45 PM, Marc <marc.boschma@gmail.com> wrote:
> (cd ../.. ; rake radiant:extensions:${extension}:migrate)
> just in case.
You can setup the load order of extensions just like you can with
plugins in a regular rails project.
config.extensions = [:load_me_first, :some_other, :all] # where all is
a placeholder for the unspecified

And there is also
rake radiant:extensions:update_all
Which will also run update for extensions loaded as gems.
This topic is locked and can not be replied to.