MasoniteFramework / orm

Masonite ORM is a beautiful Python ORM. It's also a nearly drop in replacement of the Orator ORM
https://orm.masoniteproject.com
MIT License
160 stars 47 forks source link

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

Open josephmancuso opened 4 months ago

josephmancuso commented 4 months ago

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()
  2. 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):

What database are you using?

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