-
Notifications
You must be signed in to change notification settings - Fork 4
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
New model definitions for version 2 API #64
Commits on Jun 26, 2021
-
Configuration menu - View commit details
-
Copy full SHA for d070f9c - Browse repository at this point
Copy the full SHA d070f9cView commit details -
The organizations table is the basis of a multi-tenant installation.
Configuration menu - View commit details
-
Copy full SHA for 263e7c4 - Browse repository at this point
Copy the full SHA 263e7c4View commit details -
Add Tag and ProductTags models
These models allow us to create tags that have a many-to-many relationship with Products (via the ProductTags association). Tags are sequestered within an organization.
Configuration menu - View commit details
-
Copy full SHA for 7c37101 - Browse repository at this point
Copy the full SHA 7c37101View commit details -
Fix use of datetime.now default
It should be the function rather than a constructed instance of datetime which would effectively be the time when the app started up. In practice, this default was overriden by the POST or PATCH handlers.
Configuration menu - View commit details
-
Copy full SHA for 51549f1 - Browse repository at this point
Copy the full SHA 51549f1View commit details -
This model stores references to dashboard templates. These templates are owned by an organization.
Configuration menu - View commit details
-
Copy full SHA for 5f61bde - Browse repository at this point
Copy the full SHA 5f61bdeView commit details -
Add relationship from Product to Organization
This relationship is currently nullable during the migration, but can be changed to non-nullable later.
Configuration menu - View commit details
-
Copy full SHA for 58e91bf - Browse repository at this point
Copy the full SHA 58e91bfView commit details -
This column will replace Build.git_refs, where in practice we never use the multiple ref feature.
Configuration menu - View commit details
-
Copy full SHA for c2d9774 - Browse repository at this point
Copy the full SHA c2d9774View commit details -
Add Build.uploaded_by relationship
This allows us to identify who uploaded a build.
Configuration menu - View commit details
-
Copy full SHA for 06b9dc6 - Browse repository at this point
Copy the full SHA 06b9dc6View commit details -
This enumeration column allows us to classify the edition's kind, which is useful information for edition dashboards.
Configuration menu - View commit details
-
Copy full SHA for 90e465b - Browse repository at this point
Copy the full SHA 90e465bView commit details -
Use UniqueConstraint from flask-sqlalchemy
Use the version from flask-sqlalchemy rather than the one directly from sqlalchemy for consistency.
Configuration menu - View commit details
-
Copy full SHA for 21184b8 - Browse repository at this point
Copy the full SHA 21184b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01f068a - Browse repository at this point
Copy the full SHA 01f068aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e1c39a - Browse repository at this point
Copy the full SHA 2e1c39aView commit details -
Simplify DashboardTemplate Organization relation
This removes the ForeignKeyConstraint in the most complex version of https://docs.sqlalchemy.org/en/13/orm/relationship_persistence.html#rows-that-point-to-themselves-mutually-dependent-rows which was causing us trouble.
Configuration menu - View commit details
-
Copy full SHA for c8a490e - Browse repository at this point
Copy the full SHA c8a490eView commit details
Commits on Jul 5, 2021
-
Change Tag unique constraints to __table_args__
This seems to be a better way to handle compound unique constraints?
Configuration menu - View commit details
-
Copy full SHA for 4da2cc7 - Browse repository at this point
Copy the full SHA 4da2cc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f736f8f - Browse repository at this point
Copy the full SHA f736f8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef54fa5 - Browse repository at this point
Copy the full SHA ef54fa5View commit details -
Use IntEnum to store enums as ints in DB
This is based on https://michaelcho.me/article/using-python-enums-in-sqlalchemy-models The idea is that the native enum support will store the string value in the database. It's easier in fact to just store the integer to the DB and handle the enum at the Python level.
Configuration menu - View commit details
-
Copy full SHA for 94cddb3 - Browse repository at this point
Copy the full SHA 94cddb3View commit details
Commits on Jul 6, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 2648dbb - Browse repository at this point
Copy the full SHA 2648dbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4860a17 - Browse repository at this point
Copy the full SHA 4860a17View commit details -
This is necessary for the initial database migration, but can be reset to be non-nullable once the content can be update.
Configuration menu - View commit details
-
Copy full SHA for 9d4830b - Browse repository at this point
Copy the full SHA 9d4830bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f323c5 - Browse repository at this point
Copy the full SHA 8f323c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98ce3a8 - Browse repository at this point
Copy the full SHA 98ce3a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14d99c3 - Browse repository at this point
Copy the full SHA 14d99c3View commit details -
Run postgres in tox on port 3309
This lets us run the dev server at the same time as running tox.
Configuration menu - View commit details
-
Copy full SHA for 71ecee5 - Browse repository at this point
Copy the full SHA 71ecee5View commit details
Commits on Jul 10, 2021
-
Make Edition.kind non-nullable
In the migration, apply a default value then make the column non-nullable.
Configuration menu - View commit details
-
Copy full SHA for d35057a - Browse repository at this point
Copy the full SHA d35057aView commit details -
Make Product.organization_id non-nullable
We do this by creating a default organization during the migration and then updating all products to associate with that default organization.
Configuration menu - View commit details
-
Copy full SHA for bea7d9c - Browse repository at this point
Copy the full SHA bea7d9cView commit details
Commits on Jul 12, 2021
-
Make v1 API for POST /products/ use default org
To fall back to the original LTD API, the new_product() handler gets teh first organization, which is the default organization created by the DB migration for the v2 tables. New installations of LTD, therefore, should use the v2 API in order to use the organizations feature.
Configuration menu - View commit details
-
Copy full SHA for 75dcd6d - Browse repository at this point
Copy the full SHA 75dcd6dView commit details -
Create default org to tests of the v1 API
This matches how the v2 table migration automatically associates a default organization with existing products, but otherwise the organization feature isn't exposed by the v1 API.
Configuration menu - View commit details
-
Copy full SHA for 6fd401d - Browse repository at this point
Copy the full SHA 6fd401dView commit details -
Include event string with error log messages
Structlog requires text for the event now.
Configuration menu - View commit details
-
Copy full SHA for 96e7f83 - Browse repository at this point
Copy the full SHA 96e7f83View commit details -
This order of type checking is correct because InEnum is a subclass of int.
Configuration menu - View commit details
-
Copy full SHA for b92770f - Browse repository at this point
Copy the full SHA b92770fView commit details