[ckan-dev] Adding fields to existing tables of CKAN, from extension

David Read david.read at hackneyworkshop.com
Thu Jun 7 15:22:05 UTC 2012


How about putting the value in a resource extra field? Package extras
and resource extras are designed to be freeform, for any key-value
pairs.

Whilst on the subject, my gripe with resource extras is that they were
implemented as all the extras for a resource are stored in one JSON
string, so not easily to filter by in SQL queries. If anyone can
suggest how to get round this, then I'd be delighted to hear.

Dave

On 7 June 2012 13:48, Aleksi Suomalainen <aleksi.suomalainen at nomovok.com> wrote:
> Hello,
>
> I am making an extension that creates a global id from a URN fetched from an
> external service, but the existing CKAN datamodel for eg. Resource does not
> have a global_id field and after a whole evening of googling I did not find
> a way to do this via an plugin interface.
>
> Is there another way to implement this, without me requiring to fork the
> entire CKAN codebase just to add one field to an existing datamodel?
>
> I know there are migrations that exist, but is there a way for an extension
> to add its own migration and then configure CKAN to use a migration of the
> extension?
>
> Regards,
> --
> -- Aleksi Suomalainen Software Developer at Nomovok Ltd.
> <http://www.nomovok.com/> <mailto:aleksi.suomalainen at nomovok.com=>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev




More information about the ckan-dev mailing list