Skip to content
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

refactor(dashboard,serverless): replace assets table with json column #915

Merged
merged 7 commits into from
Jun 2, 2023

Conversation

QuiiBz
Copy link
Member

@QuiiBz QuiiBz commented Jun 1, 2023

About

Replace the Asset table with an assets column inside the Deployment table which will be a lot more efficient, and makes more sense since each deployment is immutable.

The following query allows to migrate each asset row to the new asset column grouping in a json array by deployment id:

UPDATE
	Deployment AS deployment
	INNER JOIN (
		SELECT
			JSON_ARRAYAGG(name) AS assets,
			deploymentId
		FROM
			Asset
		GROUP BY
			deploymentId) AS res SET deployment.assets = res.assets
WHERE
	deployment.id = res.deploymentId

@changeset-bot
Copy link

changeset-bot bot commented Jun 1, 2023

🦋 Changeset detected

Latest commit: 5974c8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@lagon/serverless Patch
@lagon/dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jun 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2023 4:19pm
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2023 4:19pm
storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2023 4:19pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2023 4:19pm

@QuiiBz QuiiBz marked this pull request as ready for review June 2, 2023 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant