-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add support for device tags #191
Commits on Jun 1, 2022
-
Generated with: mix phx.gen.schema Devices.Tag tags tenant_id:references:tenants \ name:string:unique License headers added afterwards Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 5eec3ff - Browse repository at this point
Copy the full SHA 5eec3ffView commit details -
Adapt the generated tags schema to our needs
- Use the correct defaults for tenant_id - Scope the unique_index to :tenant_id additionally - Add the unique_index on id and tenant_id needed for foreign keys - Make name not null Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 0b57dbd - Browse repository at this point
Copy the full SHA 0b57dbdView commit details -
Add DeviceTag association schema
Generated with: mix phx.gen.schema Devices.DeviceTag devices_tags tenant_id:references:tenants \ tag_id:references:tags device_id:references:devices License header added after generation. Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 5c60732 - Browse repository at this point
Copy the full SHA 5c60732View commit details -
Rework the schema and migration to accomodate the change: - No need for a primary key in devices_tags, use a composite one - Autogenerate tenant_id (use integer since id fields can't have an autogenerate option) - Adjust all references to take tenant_id into account Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 510d99c - Browse repository at this point
Copy the full SHA 510d99cView commit details -
astarte: add tag handling in update_device
Also add relevant tests Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for ac32633 - Browse repository at this point
Copy the full SHA ac32633View commit details -
astarte: preload tags when querying the device
Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 0160a71 - Browse repository at this point
Copy the full SHA 0160a71View commit details -
Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for f8ae18a - Browse repository at this point
Copy the full SHA f8ae18aView commit details -
Add device tag handling in the GraphQL schema
Show tags for the device object and allow updating them with the update_device mutation. Add all the relevant tests. Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 8442681 - Browse repository at this point
Copy the full SHA 8442681View commit details -
Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Configuration menu - View commit details
-
Copy full SHA for 634023b - Browse repository at this point
Copy the full SHA 634023bView commit details