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
177 stars 49 forks source link

Add missing migration methods from Laravel #748

Open maicol07 opened 2 years ago

maicol07 commented 2 years ago

Describe the feature as you'd like to see it Missing table methods from Laravel docs:

I've added a ❕indicating the ones more important

What do we currently have to do now? Just add these methods

josephmancuso commented 2 years ago

Are you able to open a PR and add these?

josephmancuso commented 2 years ago

It would actually be pretty straight forward:

  1. add the method to the blueprint class
  2. add the column map to each Platform class (sqlite, mysql, Postgres and mssql)
  3. Write tests in each other test_{database}_schema_builder.py files
maicol07 commented 2 years ago

Yes, I can look at them

josephmancuso commented 2 years ago

Thanks

yubarajshrestha commented 2 years ago

@maicol07 macAddress already exists here's the code in orm

def macaddr(self, column, length=255, nullable=False):
        """Sets a column to be the macaddr representation for the table.

        Arguments:
            column {string} -- The column name.

        Keyword Arguments:
            nullable {bool} -- Whether the column is nullable. (default: {False})

        Returns:
            self
        """
        self._last_column = self.table.add_column(
            column, "macaddr", length=255, nullable=nullable
        )
        return self
maicol07 commented 2 years ago

@maicol07 macAddress already exists here's the code in orm

def macaddr(self, column, length=255, nullable=False):
        """Sets a column to be the macaddr representation for the table.

        Arguments:
            column {string} -- The column name.

        Keyword Arguments:
            nullable {bool} -- Whether the column is nullable. (default: {False})

        Returns:
            self
        """
        self._last_column = self.table.add_column(
            column, "macaddr", length=255, nullable=nullable
        )
        return self

Thanks! Checked the item in the list!