Forum: Ruby on Rails 2 apps with 1 one database.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
jef (Guest)
on 2008-10-30 22:30
(Received via mailing list)
Hi;

I am developping a web app and I've wrote some admin code (parsing web
site, sending massmail etc...) which don't need to be deployed.
So I would like this code to be part of a second developement app.

But there's a probleme regarding the schema_migrations table. it must
be unique.

How can I solve this problem?

Thanks
JF
Bill W. (Guest)
on 2008-10-30 22:40
(Received via mailing list)
Hi jef,

jef wrote:
>
> I am developping a web app and I've wrote some admin
> code (parsing web site, sending massmail etc...) which don't
> need to be deployed. So I would like this code to be part of
> a second developement app.

Interesting.  What leads you to want to separate the admin functionality
into a completely separate app?

> But there's a probleme regarding the schema_migrations table.
> it must be unique.
>
> How can I solve this problem?

The easiest way I can think of would be to simply run all your
migrations
from one of the apps.  As long as you never run any migrations from the
second app I can't think of any way you'd run into conflicts.  Doesn't
mean
you won't.  Just that I can't think of any off  the top of my head ;-)

HTH,
Bill
jef (Guest)
on 2008-10-30 22:54
(Received via mailing list)
> Interesting.  What leads you to want to separate the admin functionality
> into a completely separate app?

I  want my dev app to be equal to the production app to make
deployement easier.

> The easiest way I can think of would be to simply run all your migrations
> from one of the apps.  As long as you never run any migrations from the
> second app I can't think of any way you'd run into conflicts.  Doesn't mean
> you won't.  Just that I can't think of any off  the top of my head ;-)

I need to run migrations from the admin app.
Harold (Guest)
on 2008-10-31 00:42
(Received via mailing list)
On the other hand, I don't understand why not use role based
authorization to the admin area?
Bill W. (Guest)
on 2008-10-31 04:17
(Received via mailing list)
Harold wrote:

> On the other hand, I don't understand why not use
> role based authorization to the admin area?

Exactly.

OTOH...

> I need to run migrations from the admin app.

Like I said, it doesn't matter which app you run your migrations from.
Just
pick one.

HTH,
Bill
jef (Guest)
on 2008-10-31 12:54
(Received via mailing list)
> On the other hand, I don't understand why not use role based
> authorization to the admin area?

Most of the code is used only once. Ex:
 parse the foo.com web site and grab the email adresse.
Send email to some users (some who have a website, some who has been
born in july, some who have a dog, etc)

So I don't want to deploy that code but I want to keep it in an
appropriate place.
That's why I thougt about a second app using database of the main app.
jef (Guest)
on 2008-10-31 12:57
(Received via mailing list)
> Like I said, it doesn't matter which app you run your migrations from.  Just
> pick one.


My admin app will never be in production.
It's just  a place where I store one shot code (parsing website code,
etc ...).
Harold (Guest)
on 2008-10-31 16:59
(Received via mailing list)
Well, to me it sounds like your "admin app" is just a bunch of rake
tasks that do some bookkeeping for you. You seem to be solving a
problem that does not exist - again, what's the problem with the admin
code living in the same app? Even if it makes it to production?

Be that as it may, if you insist in having two rails apps, I would
disable the db:migrate rake task on the admin app. Make it raise an
exception. Same with the migration generator.
This topic is locked and can not be replied to.