Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Extending core tables in plugins
judgej
✭
Many (if not most) modules in Vanilla 1 messed around with the core tables, often adding columns here and there where they were needed. Vanilla 2 plugins don't seem to do that. Is that a new coding standard for Vanilla, or frowned upon, or just something I have not yet encountered?
Adding metadata to users is easy now due to the helper classes that manage all that. How about discussions and comments? If I want to add a few flags to the comments for use in my plugin, is the standard here to create a new table and add the properties to that, linking by comment and discussion IDs?
Adding metadata to users is easy now due to the helper classes that manage all that. How about discussions and comments? If I want to add a few flags to the comments for use in my plugin, is the standard here to create a new table and add the properties to that, linking by comment and discussion IDs?
0
Comments
As for extending core tables, IPTracking plugin does this:
$Structure = Gdn::Structure(); $Structure ->Table('User') ->Column('LastIP', 'varchar(14)', TRUE) ->Set(FALSE, FALSE);
"Add a column called LastIP to the User (GDN_User) table as a varchar(14) which CAN be NULL".
Vanilla Forums COO [GitHub, Twitter, About.me]
Vanilla Forums COO [GitHub, Twitter, About.me]