Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat/enterpriseportal: initialize subscriptions tables#63453

Merged
bobheadxi merged 5 commits into
mainfrom
ep-subscriptions-tables
Jun 27, 2024
Merged

feat/enterpriseportal: initialize subscriptions tables#63453
bobheadxi merged 5 commits into
mainfrom
ep-subscriptions-tables

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Jun 24, 2024

Copy link
Copy Markdown
Member

The idea is to have a table of conditions which track reasons etc for major changes to a subscription. These aren't critical - important state still gets a subscription table time field for querying - but should match.

Closes https://linear.app/sourcegraph/issue/CORE-155

Test plan

Apply https://github.com/sourcegraph/sourcegraph/pull/63452, then sg run enterprise-portal

@cla-bot cla-bot Bot added the cla-signed label Jun 24, 2024

bobheadxi commented Jun 24, 2024

Copy link
Copy Markdown
Member Author

@bobheadxi bobheadxi requested review from a team and unknwon June 24, 2024 22:06
@bobheadxi bobheadxi force-pushed the ep-subscriptions-tables branch from 921ec91 to ca3983b Compare June 24, 2024 22:13
@bobheadxi bobheadxi marked this pull request as ready for review June 24, 2024 22:18
@bobheadxi bobheadxi force-pushed the ep-subscriptions-tables branch from ca3983b to e11e559 Compare June 24, 2024 22:34
Comment on lines 14 to 16

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to take ideas on how to represent this - GORM doesn't make it super easy to set up native enums, and maybe we don't want to use native enums anyway?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using native enum would be a nice to have if low effort, otherwise, doesn't seem worth the trouble for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, it's not possible, you can use an enum type but not make it

Base automatically changed from ep-subscriptions-uuid to main June 25, 2024 00:39
@bobheadxi bobheadxi force-pushed the ep-subscriptions-tables branch from fdf7443 to 320b550 Compare June 25, 2024 00:40
Comment on lines 14 to 16

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using native enum would be a nice to have if low effort, otherwise, doesn't seem worth the trouble for now.

@bobheadxi bobheadxi force-pushed the ep-subscriptions-tables branch from 320b550 to 32bf1b3 Compare June 25, 2024 19:24
@bobheadxi bobheadxi force-pushed the ep-subscriptions-tables branch from c0c3741 to 8a5ca69 Compare June 26, 2024 21:32
@bobheadxi bobheadxi merged commit 13b315c into main Jun 27, 2024
@bobheadxi bobheadxi deleted the ep-subscriptions-tables branch June 27, 2024 00:13
bobheadxi referenced this pull request Jun 27, 2024
Closes https://linear.app/sourcegraph/issue/CORE-157

Potentially controversial decision: storing license data (the JSON data
encoded into license keys, and the license key itself) in JSONB. The
data in there isn't (and shouldn't be) interesting to query on - they're
only used in the context of a single license, so you would never use it
as conditions. The only one that might be useful is "license key
substring" for parity with what we have today, but that's an
internal-only use case and shouldn't be in the hotpath for anything
super performance sensitive.

Conditions table is similar to the one introduced in
https://github.com/sourcegraph/sourcegraph/pull/63453

## Test plan

CI
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants