A way to rename a source's display_name and description without recreating the DB?

8 views
Skip to first unread message

r.ivim...@elifesciences.org

unread,
Jun 23, 2014, 6:29:34 AM6/23/14
to plos-api-...@googlegroups.com
Folks

Is there a way to rename a source's display_name and description without recreating the DB for it. I'm thinking of some sort of update hook perhaps?

The change is to the code:

pubmed = PubMed.find_or_create_by_name(
  :name => "pubmed",
  :display_name => "PubMed Central",


(which used to be just 'PubMed') but of course such a change only affects the creation of a new DB. However I am trying to retain the already-captured data.

Is editing the 'sources' table using mysql client the best way? - I would prefer something less reliant on manual typing.

Regards
Ruth

Martin Fenner

unread,
Jun 23, 2014, 8:05:30 AM6/23/14
to plos-api-...@googlegroups.com
Ruth,

why don’t you update the display_name and description in the admin web interface?

Best,

Martin
--
You received this message because you are subscribed to the Google Groups "PLOS API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plos-api-develo...@googlegroups.com<mailto:plos-api-develo...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

r.ivim...@elifesciences.org

unread,
Jun 23, 2014, 8:11:12 AM6/23/14
to plos-api-...@googlegroups.com

> why don’t you update the display_name and description in the admin web interface? 

Partly, because I forget that you can edit more than you can see before you hit edit when on the config page :-)

Partly because I have got used to writing text file updates to 'roll out' changes and I was wondering if a similar mechanism, such as the 'db/migrate' code, would be suitable.

I have ended up with a SQL file containing update statements that I can execute on test and prod servers.
Reply all
Reply to author
Forward
0 new messages