-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes to improved categories #1747
Conversation
a820d97
to
e09837e
Compare
Changes Unknown when pulling e09837e on fixes-to-improved-categories into ** on develop**. |
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class JoinPostsTagsTableToAttribute extends AbstractMigration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@willdoran can you sanity check this migration?
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3) | ||
*/ | ||
|
||
class Ushahidi_Repository_Post_Tags extends Ushahidi_Repository_Post_Value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Angamanga have a look at this. This allows us to have an attribute type
that loads from the posts_tags table ... I've just added a form_attribute_id to the existing table. Still working on changes to the posts repo though
5b8add9
to
72ae137
Compare
'update' => 'CASCADE', | ||
]) | ||
->update(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjmackay my understanding is that this will:
Add form_attribute to post_tags
Change tag attribute type to tags
Copy all Form Attributes of type tags
For each attribute use From === a give post_tags's post's from_id, update the post_tag form_attribute_id
Add foreign key constraints for posts_tags form_attribute_id
If that flow is the desired one then this code works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy all Form Attributes of type tags
For each attribute use From === a give post_tags's post's from_id, update the post_tag form_attribute_id
Something like that. It grabs the first tag attribute for each form, and uses that to set form_attribute_id for existing posts_tags values.
96fc128
to
a17c129
Compare
- Add extra field to posts_tags - Remove tags from post_varchar - Add Post/Tags validator - Add Post/Tags repo
This isn't 100% compatible, but we at least save tags *if* the form has a tags attribute
- Stop using forms_tags table - Just use form_attribute.options instead
9c10223
to
138e5cc
Compare
52ce8b5
to
77046c6
Compare
This pull request makes the following changes:
tags
type attributes to the "post fields" not tasks.Test these changes by:
Fixes #1397
Ping @ushahidi/platform
This change is