Skip to content

Test for migrating int to bigint is not in sync with expected result description #3933

Closed

Description

@borutjures

Describe the bug

Test comment says the migration will be left to the user, however the warning is not produced.

I believe this is due to if (!srcColumn.like(dstColumn)) treating int and bigint as alike in generateTableMigration(). As a result, the code that would add the warning is not executed.

The types are treated as alike in the ColumnType.like() extension.

To reproduce

Run the tests for integer and bigint in tools/serverpod_cli/test/database/migration/column_types_test.

Expected behavior

I believe the tests (test 1 and test 2) should be changed to expect hasLength(2) for actions and warnings:

    test('then migration actions are created.', () {
      expect(migration.actions, hasLength(2));
    });

    test('then warnings are created.', () {
      expect(migration.warnings, hasLength(2));
    });

Library version

3.0.0-alpha.1

Platform information

macos

Additional context

No response

How experienced are you with this library?

Intermediate - Familiar with the basics or have used it in a few projects

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    bug
    on Aug 29, 2025
  2. self-assigned this
    on Sep 1, 2025
  3. moved this from Inbox 📫 to Next Up 🎯 in Serverpod Frameworkson Sep 1, 2025
  4. SandPod commented on Oct 1, 2025

    @SandPod
    Contributor

    @borutjures - The tests are valid and represent our expected behavior.

    We do not want to issue a warning for this. The bigint column type will be used for new tables, but for older tables, int will continue to be used and should produce no error.

    This is documented in the migration guide for 2.0 where this was introduced: https://docs.serverpod.dev/upgrading/upgrade-to-two#integer-representation-changed-to-bigint

  5. moved this from Next Up 🎯 to Done 🚀 in Serverpod Frameworkson Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions