Skip to content

Fix/normalized tables type bug #521

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

Merged
merged 6 commits into from
Jun 19, 2025
Merged

Conversation

icecrasher321
Copy link
Collaborator

Description

Typing change to fix lint.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

Copy link

vercel bot commented Jun 19, 2025

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

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2025 10:55pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jun 19, 2025 10:55pm

@vercel vercel bot temporarily deployed to Preview – docs June 19, 2025 22:46 Inactive
@vercel vercel bot temporarily deployed to Preview – sim June 19, 2025 22:46 Inactive
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Changes database schema to fix typing issues in workflow block positioning by converting position_x, position_y, and height columns from integer to numeric type in the workflow_blocks table.

  • Modifies apps/sim/db/schema.ts to use decimal types for positionX, positionY and height fields
  • Updates apps/sim/lib/workflows/db-helpers.ts to properly convert between string DB fields and numeric application values
  • Adds migration 0044_uneven_killer_shrike.sql to safely convert existing data to new numeric format
  • Sets default value of '0' for height column to ensure data consistency

5 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

ALTER TABLE "workflow_blocks" ALTER COLUMN "position_x" SET DATA TYPE numeric;--> statement-breakpoint
ALTER TABLE "workflow_blocks" ALTER COLUMN "position_y" SET DATA TYPE numeric;--> statement-breakpoint
ALTER TABLE "workflow_blocks" ALTER COLUMN "height" SET DATA TYPE numeric;--> statement-breakpoint
ALTER TABLE "workflow_blocks" ALTER COLUMN "height" SET DEFAULT '0';
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Using string '0' as default for numeric column is inconsistent. Should be numeric literal 0 without quotes

Suggested change
ALTER TABLE "workflow_blocks" ALTER COLUMN "height" SET DEFAULT '0';
ALTER TABLE "workflow_blocks" ALTER COLUMN "height" SET DEFAULT 0;

Comment on lines +134 to +135
positionX: String(block.position?.x || 0),
positionY: String(block.position?.y || 0),
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Position values should be rounded before String conversion to prevent floating point precision issues

Vikhyath Mondreti added 2 commits June 19, 2025 15:50
@vercel vercel bot temporarily deployed to Preview – docs June 19, 2025 22:50 Inactive
@icecrasher321 icecrasher321 merged commit cc74921 into main Jun 19, 2025
4 of 5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/normalized-tables-type-bug branch June 20, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant