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

Changing a column on sqlite from integer to varchar removes data types on unsigned integer columns #871

Open
josephmancuso opened this issue Feb 26, 2024 · 0 comments
Assignees
Labels
bug An existing feature is not working as intended

Comments

@josephmancuso
Copy link
Member

Describe the bug
I believe this only happens Changing a column on sqlite from integer to varchar removes data types on unsigned integer columns

To Reproduce
Steps to reproduce the behavior:

  1. create a migration that adds integer unsigned and assign it a foreign key to other tables
with self.schema.create("course_progress") as table:
            table.big_increments("id")
            table.integer("user_id").unsigned()
            table.integer("course_id").unsigned()
            table.integer("step")
            table.foreign("user_id").references("id").on("users")
            table.foreign("course_id").references("id").on("courses")
            table.timestamps()
  1. then create another migration that changes the step column from integer to varchar
with self.schema.table("course_progress") as table:
            table.string("step").change()

now both the user_id and course_id columns lose their data types

Expected behavior
table should be fully rebuilt to include foreign keys and other columns

Screenshots or code snippets
Screenshots help a lot. If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Mac OSX, Windows]
  • Version [e.g. Big Sur, 10]

What database are you using?

  • Type: [e.g. Postgres, MySQL, SQLite]
  • Version [e.g. 8, 9.1, 10.5]
  • Masonite ORM [e.g. v1.0.26, v1.0.27]

Additional context
Any other steps you are doing or any other related information that will help us debug the problem please put here.

@josephmancuso josephmancuso added the bug An existing feature is not working as intended label Feb 26, 2024
@josephmancuso josephmancuso self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature is not working as intended
Projects
Status: No status
Development

No branches or pull requests

1 participant