Boti

extending the asset object from a plugin

Vote 0 Votes

I need to extend the asset and teh entry table with a new fields

the entry table gets the new filed but the asset table does not, but it also does not give any error either

the yaml config for this is the following

object_types:
entry:
fullscreen: smallint
photocredit: string(255)
credit_all: smallint
deck: string(255)
asset:
photocredit: string(255)

so as i said the entry table gets upgraded but the asset table does not

is there something i do wrong here or is there a limitation that prevents adding a field to the asset table from a plugin?

Thank you for any hint

Reported on Movable Type 5

4 Replies

| Add a Reply
  • i paste the code again


    object_types:
    entry:
    fullscreen: smallint
    photocredit: string(255)
    credit_all: smallint
    deck: string(255)

    asset:
    photocredit: string(255)

  • You have to specify a schema_version in your config.yaml. It's a root-level key. If you don't have one, just add schema_version: 1 near the top of the file.

  • Of course I have a schema_version. otherwise the object types has no effect.
    What I was saying is that given the above extension to the entry and asset objects only the entry gets extended but the asset does not. By extended I mean that the mt_entry table will be altered with the new columns/fields but the mt_asset table remains unchanged.

  • Why don't you post a link to the config.yaml file...

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012