-
-
Notifications
You must be signed in to change notification settings - Fork 790
feat: impact metrics migration #10551
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
db.runSql( | ||
` | ||
CREATE TABLE IF NOT EXISTS impact_metrics( | ||
id TEXT NOT NULL PRIMARY KEY, |
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.
it will be ulid generated by code
` | ||
CREATE TABLE IF NOT EXISTS impact_metrics( | ||
id TEXT NOT NULL PRIMARY KEY, | ||
feature VARCHAR(255), |
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.
can be null for global impact metrics
CREATE TABLE IF NOT EXISTS impact_metrics( | ||
id TEXT NOT NULL PRIMARY KEY, | ||
feature VARCHAR(255), | ||
config JSONB NOT NULL, |
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.
implicit schema for CRUD config
id TEXT NOT NULL PRIMARY KEY, | ||
feature VARCHAR(255), | ||
config JSONB NOT NULL, | ||
FOREIGN KEY (feature) REFERENCES features(name) ON DELETE CASCADE |
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.
if related to feature it has to be a valid feature
About the changes
We want to store impact metrics configuration per flag. Previously we were storing impact metrics in global settings. This new table will accommodate both metrics for a flag and global ones (null feature field).
I decoded to model config as JSONB since we're not going to do any joins and we need to store data of this shape:
This is basically CRUD for this screen

Important files
Discussion points